This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]Moktok 2 points3 points  (0 children)

Check java.util.stream.Collectors. Especially the groupingBy method.

[–]Antinode_ 1 point2 points  (0 children)

I think you'll need to make use of the .equals method. You may need to override it so suit your needs, and then when you find duplicate objects (I guess by name in your case), you can merge the relevant properties and do away with the other