In Java 8 how can I filter a collection using the Stream API by checking the distinctness of a property of each object?
Stream
For example I have a list of
You can use StreamEx library:
StreamEx.of(persons) .distinct(Person::getName) .toList()