I have list List where Custom is like
List
Custom
class Custom{ public int id; public String name; }
How to
There is no easier solution with the standard collections. You have to iterate over the list and count the occurrences of the name.