I have a method that returns Sets of sets. Following is what I mean:
public static HashSet methodName(){
HashSet c= new HashSet();
c.add(x); //x is a HashSet of number
c.add(y); //y is a Hashset of numbers
return c;
}
After the method returns the collections, I enter it into an arraylist
ArrayList<HashSet> xxx= new ArrayList<Hashset>();
y=methodName();
xxx.add(y);
The method gets called couple of times and each time I enter sets of sets into the arraylist.
My question is. now I want to go through the arraylist and find the set that contains the smallest number of sets. How do I do that? Thanks so much in advance. Any help will be appreciated.