title: Java 8, Lambda: Sorting within grouped Lists and merging all groups to a list
body: <p>Based on the following answer: <a href="https://stackoverflow.com/a/30202075/8760211">https://stackoverflow.com/a/30202075/8760211</a></p>
  
  <p>How to sort each group by stud_id and then return a List with all Students as result of the grouping by stud_location and then sorting by stud_id)?</p>
  
  <p>It would be great to have this as extension to the existing Lambda Expression:</p>
  
  <pre><code>Map&lt;String, List&lt;Student&gt;&gt; studlistGrouped =
      studlist.stream().collect(Collectors.groupingBy(w -&gt; w.stud_location));
  </code></pre>
  
  <p>I need the Grouping based on the order of the Elements in the origin List.</p>
  
  <pre><code>First group: "New York"
  Second group: "California"
  Third group: "Los Angeles"
  
  1726, "John", "New York"
  4321, "Max", "California"
  2234, "Andrew", "Los Angeles"
  5223, "Michael", "New York"
  7765, "Sam", "California"
  3442, "Mark", "New York"
  </code></pre>
  
  <p>The result would then look like the following:</p>
  
  <pre><code>List&lt;Student&gt; groupedAndSorted = ....
  
      1726, "John", "New York"
      3442, "Mark", "New York"
      5223, "Michael", "New York"
      4321, "Max", "California"
      7765, "Sam", "California"
      2234, "Andrew", "Los Angeles"
  </code></pre>
  
  <p>I have tried the following:</p>
  
  <pre><code>studlistGrouped.entrySet().stream().sorted(Comparator.compar‌​ing(Map.Entry::getVa‌​lue))
  </code></pre>
  
  <p>But this doesn't work.</p>