How to convert a Map<K, V> into two list while keeping the order?
<p>How can I convert a <code>Map&lt;K, V&gt;</code> into lists<code>List&lt;K&gt; keys</code>, <code>List&lt;V&gt; values</code>, such that the order in <code>keys</code> and <code>values</code> match? I can only find <code>Set&lt;K&gt; Map#keySet()</code> and <code>Collection&lt;V&gt; Map#values()</code> which I could convert to lists using:</p>

<pre><code>List&lt;String&gt; keys   = new ArrayList&lt;String&gt;(map.keySet());
List&lt;String&gt; values = new ArrayList&lt;String&gt;(map.values());
</code></pre>

<p>but I worry that the order will be random.</p>

<p>Is it correct that I have to manually convert them or is there a shortcut somewhere?</p>

<p>Update: Owing to the answers I was able to find additional, useful information which I like to share with you, random google user: 
<a href="http://stackoverflow.com/questions/46898/how-do-i-iterate-over-each-entry-in-a-map">How do I iterate over each Entry in a Map?</a></p>
