This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
What is the easiest way to find elements with the same Value in a List? Is there a utility class that allows you to determine if a list contains duplicate "values"? How about the number of duplicate values?
Landon, The easiest thing I can think of is to put all the objects in a HashSet and then compare the number of elements in the set to the number of elements in a list. The set takes care of filtering duplicates. And the difference in size would be the number of duplicates.
Alternately, if you want to know the number of duplicates for each element, you can use something like the MultiCounter I posted here. You could add methods to do things like find the most common element, or give a Set of all the keys.