title: Sort List of List of MyType
body: <p>Thanks to eran, I have the following Lambda which creates a list of list of myType. MyType contains a field named <code>dateOfContainer</code>.
  My question now would be if there is a possibility to extends the expression in order to sort the <code>List&lt;MyType&gt;</code> of <code>List&lt;List&lt;MyType&gt;&gt;</code> list by <code>dateOfContainer</code>?</p>
  
  <pre><code>List&lt;List&lt;MyType&gt;&gt; list = new ArrayList&lt;&gt; (
  myList.stream().collect (Collectors.groupingBy(MyType::getDateOfContainer)).values());
  </code></pre>
  
  <p>[EDIT]</p>
  
  <p>Thanks a lot for the suggestions. Iam still fighting witch this expression. My current expression looks like this:</p>
  
  <pre><code>List&lt;List&lt;ScheduleIntervalContainer&gt;&gt; list = new ArrayList&lt;&gt;(
               structuredScheduleIntervalContainers.stream().sorted(Comparator.comparing(ScheduleIntervalContainer::getDateOfContainer))
              .collect(Collectors.groupingBy(ScheduleIntervalContainer::getDateOfContainer, LinkedHashMap::new, Collectors.toList())).values());
  </code></pre>
  
  <p>but I am getting this error in eclipse: </p>
  
  <blockquote>
    <p>The method <code>sorted(Comparator&lt;? super List&lt;ScheduleIntervalContainer&gt;&gt;)</code> in the type <code>Stream&lt;List&lt;ScheduleIntervalContainer&gt;&gt;</code> is not applicable for the arguments <code>(Comparator&lt;ScheduleIntervalContainer&gt;)</code></p>
  </blockquote>