title: Java HashMap key value storage and retrieval
body: <p>I want to store values and retrieve them from a Java HashMap.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>public void processHashMap()
  {
      HashMap hm = new HashMap();
      hm.put(1,"godric gryfindor");
      hm.put(2,"helga hufflepuff"); 
      hm.put(3,"rowena ravenclaw");
      hm.put(4,"salazaar slytherin");
  }
  </code></pre>
  
  <p>I want to retrieve all Keys and Values from the HashMap as a Java Collection or utility set (for example <code>LinkedList</code>).</p>
  
  <p>I know I can get the value if I know the key, like this:  </p>
  
  <pre><code>hm.get(1);
  </code></pre>
  
  <p>Is there a way to retrieve key values as a list?</p>