title: How to sort and print hashMap in java
body: <p>i got a hashMap in java with the following output when i use the toString()</p>
  
  <p><code>{to=3, but=2, said=1, hid=1, Newton=6, by=1, eyes=2, of=2, meter=3, hide=1, his=1, on=1, drew=1, Einstein=5,......}</code></p>
  
  <p>my hashMap has the following syntax: <code>&lt;String, Integer&gt;</code></p>
  
  <p>now i want to sort it like that :</p>
  
  <pre><code>  6: Newton
    6: and
    5: Einstein
    3: Pascal
    3: found
    3: meter
    3: one
    3: to
    2: a , ....
  </code></pre>
  
  <p>which means i have to sort by the integer value. also the "style" of the output should be like seen above. can anyone help me please, i have exams tomorrow :D</p>