title: How to have sorted entries in an arbitrary order in Java HashMap
body: <p>Good day all.
  I've this situation:</p>
  
  <pre><code>Map&lt;String, List&lt;HubP&gt;&gt; hubP = new HashMap&lt;&gt;();
  hubP.put(HubP.TYPE_ONLINE, onlineP);
  hubP.put(HubP.TYPE_HOME, offlineP);
  return hubP;
  </code></pre>
  
  <p><code>HubP.ONLINE = "ONLINE"</code> and <code>HubP.TYPE_HOME = "HOME"</code></p>
  
  <p>So this basically is returning to my frontend an array which "HOME" is the first element.</p>
  
  <p>I'd like to have "ONLINE" as the first element, and then any other element present (my only concern is to have "ONLINE" for first, then all the others could be in any order)</p>
  
  <p>I've already done it on my frontend, by checking the array and reverse it in js if needed, but this solution is really dirt and I'd like to make it on the server.</p>
  
  <p>is that possible? I'm using HasMap but maybe I've done wrong.</p>