title: Nested wildcard generics variable affectation
body: <p>Given the following Java code:</p>
  
  <pre><code>public class Test {
      public static class A&lt;T&gt; {
          private T t;
  
          public A(T t) {
              this.t = t;
          }
  
          public T getT() {
              return t;
          }
  
          public void setT(T t) {
              this.t = t;
          }
      }
  
      public static class B&lt;T&gt; {
          private T t;
  
          public B(T t) {
              this.t = t;
          }
  
          public T getT() {
              return t;
          }
  
          public void setT(T t) {
              this.t = t;
          }
      }
  
      public static class F&lt;T&gt; {
          private T t;
  
          public F(T t) {
              this.t = t;
          }
  
          public A&lt;B&lt;T&gt;&gt; construct() {
              return new A&lt;&gt;(new B&lt;&gt;(t));
          }
  
          public T getT() {
              return t;
          }
  
          public void setT(T t) {
              this.t = t;
          }
      }
  
      public static void main(String[] args) {
          F&lt;?&gt; f = new F&lt;&gt;(0);
          // 1: KO
          // A&lt;B&lt;?&gt;&gt; a = f.construct();
          // 2: KO
          // A&lt;B&lt;Object&gt;&gt; a = f.construct();
          // 3: OK
          // A&lt;?&gt; a = f.construct();
      }
  }
  </code></pre>
  
  <p>In the main method of the <code>Test</code> class, what is the correct type of a variable that will receive the result of <code>f.construct()</code> ?
  This type should be something like <code>A&lt;B&lt;...&gt;&gt;</code> where <code>...</code> is what I'm looking for.</p>
  
  <p>There are 3 commented lines of code above which represent my attempts to solve this problem.
  The first and second lines aren't valid.
  The third is but I loose the <code>B</code> type information and I have to cast <code>a.getT()</code>.</p>