title: Initializing a Map with List inside
body: <p>I need to use a Map with a List inside :</p>
  
  <pre><code>Map&lt;String, List&lt;String&gt;&gt; keyToGroup = new HashMap&lt;String, ArrayList&lt;String&gt;&gt;();
  </code></pre>
  
  <p>I am getting compiler error on this line in eclipse.</p>
  
  <p>The only working thing seem to be changing the inside List in the Map to ArrayList</p>
  
  <pre><code>Map&lt;String, ArrayList&lt;String&gt;&gt; keyToGroup = new HashMap&lt;String, ArrayList&lt;String&gt;&gt;();
  </code></pre>
  
  <p>I had to change the signature of many interfaces' methods, but I still don't get it; why isn't the first definition work? </p>
  
  <p>Isn't it the same, should not </p>
  
  <pre><code>Map&lt;String, List&lt;String&gt;&gt; keyToGroup 
  </code></pre>
  
  <p>&amp;</p>
  
  <pre><code>Map&lt;String, ArrayList&lt;String&gt;&gt;
  </code></pre>
  
  <p>be the same?</p>