title: Java Programming help
body: <p>I have a method that returns Sets of sets. 
  Following is what I mean:</p>
  
  <pre><code>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;
  }
  </code></pre>
  
  <p>After the method returns the collections, I enter it into an arraylist</p>
  
  <pre><code>ArrayList&lt;HashSet&gt; xxx= new ArrayList&lt;Hashset&gt;();
  y=methodName();
  xxx.add(y);
  </code></pre>
  
  <p>The method gets called couple of times and each time I enter sets of sets into the arraylist.</p>
  
  <p>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. </p>