title: Java Streams Filtering Nested Collections by Min/Max
body: <p>I have a <code>Map&lt;Integer, List&lt;MyDayObject&gt;&gt;</code> that represents all days by week of year.<br>
  Now I need to analyze only the days that produced the highest value for each week. I have been able to get the nested streaming working with a <code>forEach</code> but I can't seem to be able to correctly stream it and <code>collect</code> into a <code>List</code> at the end.</p>
  
  <pre><code>weeks.forEach((k, v) -&gt; { 
          MyDayObject highest = v.stream()
              .max((o1, o2) -&gt; o1.value().compareTo(o2.value())).get();      
          System.out.println(highest);
      });
  </code></pre>
  
  <p>What I need though is not to print it but get a <code>List&lt;MyDayObject&gt; allHighest</code> at the end.  </p>
  
  <p>I tried <code>.filter</code>ing the <code>.entrySet()</code> by <code>.max()</code> but can't get that to work.<br>
  What's the best way to filter a <code>Map</code> by <code>max</code> of the nested <code>List</code>?  </p>