I have list List where Custom is like
List
Custom
class Custom{ public int id; public String name; }
How to
Easier probably not. Now you could store your objects in a Map > instead where the key is the name. To get the number of items where name == "Tom" you can then simply do:
List l = myMap.get("Tom"); int count = 0; if (l != null) { count = l.size(); }