title: How can I split a list into sublists
body: <p>Unfortuantely, I'm in Java 7 so I can't use any Java 8's facilities.</p>
  
  <p>I have the following enum:</p>
  
  <pre><code>public enum Type
  {
      MAILING,
      RESEPT,
      CURRENT,
      //...
      USER
  }
  </code></pre>
  
  <p>and the class container of that type:</p>
  
  <pre><code>public class Container
  {
      public Type getType()
      {
          // Impl
      }
  }
  </code></pre>
  
  <p>Now I have some <code>List&lt;Container&gt;</code>. How can I split it into <code>List&lt;List&lt;Container&gt;&gt;</code> such that any <code>List&lt;Container&gt;</code> in the <code>List&lt;List&lt;Container&gt;&gt;</code> contains only <code>Container</code>s with the same <code>getType()</code>.</p>