title: How to have a key with multiple values in a map?
body: <p>I have a map like this</p>
  
  <pre><code>Map map=new HashMap();//HashMap key random order.
  map.put("a",10);
  map.put("a",20);
  map.put("a",30);
  map.put("b",10);
  
  System.out.println("There are "+map.size()+" elements in the map.");
  System.out.println("Content of Map are...");
  Set s=map.entrySet();
  Iterator itr=s.iterator();
  while(itr.hasNext())
  {
      Map.Entry m=(Map.Entry)itr.next();
      System.out.println(m.getKey()+"\t"+m.getValue()+"\t"+ m.hashCode());
  }
  </code></pre>
  
  <p>Output of the above program is</p>
  
  <pre class="lang-none prettyprint-override"><code>There are 2 elements in the map.
  Content of Map are...
  b   10  104
  a   30  127
  </code></pre>
  
  <p>Now I want that key a should have multiple values like</p>
  
  <pre class="lang-none prettyprint-override"><code>a 10
  a 20
  a 30
  </code></pre>
  
  <p>So that I should get all the values associated by a. Please advise how can I achieve that same thing. By nesting of collections, I want key 'a' to have all the three values.</p>