title: Get the keys with the biggest values from a hashmap?
body: <p>I have a <code>HashMap</code> defined like this...</p>
  
  <pre><code>HashMap&lt;String,Integer&gt; uniqueNames = new HashMap&lt;String,Integer&gt;();
  </code></pre>
  
  <p>It stores a name, and the occurence of that name. For example...</p>
  
  <pre><code>uniqueNames.put("lastname",42);
  </code></pre>
  
  <p>How can I get the name with the highest occurrence?</p>
  
  <p>For some more information, I'm working with a binary search tree of "people", storing the unique names and frequencies in a <code>HashMap</code>. What I want to do is to print the most common last names, and someone told me to use <code>HashMap</code> as I wanted to store a <code>String</code> together with an <code>Integer</code>. Maybe I should use a class to store the name and frequency instead? Could someone please offer some suggestions.</p>