title: Java 8 Map.Entry comparator
body: <p>I've been trying to make <strong>Map.Entry Comparator</strong> in Java8 using lambda expressions and have found a very strange behaviour.</p>
  
  <pre><code>Map&lt;Integer, String&gt; map = new TreeMap&lt;&gt;();
  
  map.put(1, "Hello");
  map.put(3, "zzzz");
  map.put(2, "aaaa");
  map.put(5, "AAAAA");
  map.put(4, "aaaa");
  
  Comparator&lt;Map.Entry&lt;Integer, String&gt;&gt; com = Comparator.comparing(Map.Entry::getValue);
  com = com.reversed();
  
  Comparator&lt;Map.Entry&lt;Integer, String&gt;&gt; com2 = Comparator.comparing(Map.Entry::getValue).reversed();
  </code></pre>
  
  <p><b>com</b> works just fine, but <b>com2</b> contains a misstake "<em>cannot resolve method getValue</em>". And I really don't know why? Any suggestions?</p>
  
  <p>P.S. Is there any way to avoid typing <strong>Map.Entry</strong> with <strong>Integer, String</strong>? Any shorter way?</p>