title: Delay binding of second-level type parameter
body: <p>This is a bit of a contrived reproducing case, but bear with me. </p>
  
  <p>Suppose you want to create an adder interface for classes capable of adding items to different types of lists with the following behavior:</p>
  
  <pre><code>// Can add items to any type of array list.
  Adder&lt;ArrayList&gt; arrayListAdder = ...;
  // Ok. Right list type and item types match.
  arrayListAdder.add(new ArrayList&lt;String&gt;(), "test");
  // Ok. Right list type and item types match.
  arrayListAdder.add(new ArrayList&lt;Integer&gt;(), 3);
  // Compile error. Item types do not match.
  arrayListAdder.add(new ArrayList&lt;Integer&gt;(), "test");
  // Compile error. Wrong list type although item types match.
  arrayListAdder.add(new LinkedList&lt;String&gt;(), "test");
  </code></pre>
  
  <p>In other words, I want the interface to say: </p>
  
  <blockquote>
    <p>An adder for an specific list type has a method 'add'. This method takes two arguments. 
    The first is a list of this specific type with items of type T. 
    The second argument is an item of type T. The method adds the item to the list. </p>
  </blockquote>
  
  <p>I tried with different solutions along the lines of:</p>
  
  <pre><code>interface Adder&lt;L extends List&lt;?&gt;&gt; {
      &lt;T&gt; void add(L&lt;T&gt; list, T t);
  }
  </code></pre>
  
  <p>But the expression <code>L&lt;T&gt;</code> is illegal in its context. The error message I get is "Type 'L' does not have type parameters". </p>
  
  <p>I cannot find a way of leaving the type parameter of the list open until the definition of the add method. Is there any way of specifying this interface, or does that require higher-order generics or something else which Java doesn't have?</p>