title: Restructure List<MyType> to List<List<MyType>>
body: <p>I have an ArrayList which looks like this:</p>
  
  <pre><code>final List&lt;MyType&gt; myList = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>MyType looks like this: </p>
  
  <pre><code>public class MyType {
     ...
     private DateTime startTime;
     private DateTime endTime;
     private DateTime dateOfContainer; // I use @JSONSerializer here to only serialize date
     ....
  }
  </code></pre>
  
  <p>The JSON looks like this: </p>
  
  <pre><code>[
   {
  ...
  "endTime": "16:00",
  "startTime": "13:00",
  "dateOfContainer": "27.11.2015"
  },
  {
  ...
  "endTime": "12:00",
  "startTime": "08:00",
  "dateOfContainer": "27.11.2015"
  },
  {
  ... 
  "endTime": "16:00",
  "startTime": "13:00",
  "dateOfContainer": "25.11.2015"
  }, 
  {
  ...
  "endTime": "19:00",
  "startTime": "18:00",
  "dateOfContainer": "21.11.2015"
  },
  ...
  </code></pre>
  
  <p>Now I would a list like this: </p>
  
  <pre><code>List&lt;List&lt;MyType&gt;&gt;
  </code></pre>
  
  <p>where MyType's with the same <strong>dateOfContainer</strong> are together, e.g. the first two. </p>
  
  <p>Is there a simple way with Java-8 to do this?
  Thanks a lot!</p>