title: Get max key of Map<K,V> using lambda
body: <p>I have a <code>Map&lt;Float, String&gt;</code> and would like to get the maximum of all keys. In C# I would do something like this:</p>
  
  <pre><code>var dictionary = new Dictionary&lt;float, string&gt;{{5,"foo"}, {42, "bar"}, {0, "foobarz"}};
  float max = dictionary.Max(x =&gt; x.Key); //42
  </code></pre>
  
  <p>Now I'm looking for a way to do the same using Java 8 lambdas, but the closest I got is:</p>
  
  <pre><code>float max = (float)map.keySet().stream().mapToDouble((x) -&gt; x).summaryStatistics().getMax();
  </code></pre>
  
  <p>This looks awful and requires completely unnecessary type casts. Is there a better way to do this?</p>