Finding duplicate entries in Collection
问题 Is there a tool or library to find duplicate entries in a Collection according to specific criteria that can be implemented? To make myself clear: I want to compare the entries to each other according to specific criteria. So I think a Predicate returning just true or false isn't enough. I can't use equals . 回答1: It depends on the semantic of the criterion: If your criterion is always the same for a given class, and is inherent to the underlying concept , you should just implement equals and