title: java generics and the addAll method
body: <p>What is the correct type of argument to the addAll(..) method in Java collections? If I do something like this:</p>
  
  <pre><code>List&lt;? extends Map&lt;String, Object[]&gt;&gt; currentList = new ArrayList&lt;Map&lt;String, Object[]&gt;&gt;();
  Collection&lt;HashMap&lt;String, Object[]&gt;&gt; addAll = new ArrayList&lt;HashMap&lt;String, Object[]&gt;&gt;();
  // add some hashmaps to the list..
  currentList.addAll(addAll); 
  </code></pre>
  
  <p>I understand I need to initialize both variables. However, I get a compilation error (from eclipse):</p>
  
  <pre><code>Multiple markers at this line
      - The method addAll(Collection&lt;? extends capture#1-of ? extends Map&lt;String,Object[]&gt;&gt;) in the type List&lt;capture#1-of ? extends Map&lt;String,Object[]&gt;&gt; is not applicable for the arguments (List&lt;capture#2-of ? extends 
       Map&lt;String,Object[]&gt;&gt;)
      - The method addAll(Collection&lt;? extends capture#1-of ? extends Map&lt;String,Object[]&gt;&gt;) in the type List&lt;capture#1-of ? extends Map&lt;String,Object[]&gt;&gt; is not applicable for the arguments 
       (Collection&lt;HashMap&lt;String,Object[]&gt;&gt;)
  </code></pre>
  
  <p>what am I doing wrong? </p>