title: Sorted hashmap iteration
body: <p>I have such code:</p>
  
  <pre><code>HashMap&lt;Long, TempPosition&gt; positions = getTempPositions();
      for (SortedMap.Entry&lt;Long, TempPosition&gt; p: positions.entrySet()) {...}
  </code></pre>
  
  <p>The problem is the 'positions' is not sorted or non valid sorted. What the easiest way to iterate through the hashmap and save its current order?</p>
  
  <p>Thank you</p>