title: Java Ordered Map
body: <p>In Java, Is there an object that acts like a Map for storing and accessing key/value pairs, but can return an ordered list of keys and an ordered list of values, such that the key and value lists are in the same order?</p>
  
  <p>So as explanation-by-code, I'm looking for something that behaves like my fictitious OrderedMap:</p>
  
  <pre><code>OrderedMap&lt;Integer, String&gt; om = new OrderedMap&lt;&gt;();
  om.put(0, "Zero");
  om.put(7, "Seven");
  
  String o = om.get(7); // o is "Seven"
  List&lt;Integer&gt; keys = om.getKeys();
  List&lt;String&gt; values = om.getValues();
  
  for(int i = 0; i &lt; keys.size(); i++)
  {
      Integer key = keys.get(i);
      String value = values.get(i);
      Assert(om.get(key) == value);
  }
  </code></pre>