title: Using Java8 Stream to find the highest values from map
body: <p>I wrote following method to find the keys mapped to the highest values and trying to convert to java <code>Stream</code>s. Can you please help?</p>
  
  <pre><code>private List&lt;Integer&gt; testStreamMap(Map&lt;Integer, Long&gt; mapGroup) 
  {
      List&lt;Integer&gt; listMax = new ArrayList&lt;Integer&gt;();
      Long frequency = 0L;
      for (Integer key : mapGroup.keySet()) {
          Long occurrence = mapGroup.get(key);
          if (occurrence &gt; frequency) {
              listMax.clear();
              listMax.add(key);
              frequency = occurrence;
          } else if (occurrence == frequency) {
              listMax.add(key);
          }
      }
      return listMax;
  }
  </code></pre>