Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java 8 list of objects get only first occurance

Set<String> set = new HashSet<>(persons.size());
persons.stream().filter(p -> set.add(p.getName())).collect(Collectors.toList());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #list #objects #occurance
ADD COMMENT
Topic
Name
6+7 =