title: Java nested generic type
body: <p>How come one must use the generic type <code>Map&lt;?,&nbsp;?&nbsp;extends&nbsp;List&lt;?&gt;&gt;</code> instead of a simpler <code>Map&lt;?,&nbsp;List&lt;?&gt;&gt;</code> for the following <code>test()</code> method?</p>
  
  <pre><code>public static void main(String[] args) {
      Map&lt;Integer, List&lt;String&gt;&gt; mappy =
          new HashMap&lt;Integer, List&lt;String&gt;&gt;();
  
      test(mappy);
  }
  
  public static void test(Map&lt;?, ? extends List&lt;?&gt;&gt; m) {}
  
  // Doesn't compile
  // public static void test(Map&lt;?, List&lt;?&gt;&gt; m) {}
  </code></pre>
  
  <p>Noting that the following works, and that the three methods have the same erased type anyways.</p>
  
  <pre><code>public static &lt;E&gt; void test(Map&lt;?, List&lt;E&gt;&gt; m) {}
  </code></pre>