title: List<String> cannot be converted to List<?>
body: <p>I have a builder class with a method that takes List of unknown type</p>
  
  <pre><code>public class A{
      private List&lt;D&lt;?&gt;&gt; data;
      public void setData(List&lt;D&lt;?&gt;&gt; data){
          this.data=data;
      }
  }
  public class D&lt;T&gt;{
          private List&lt;T&gt; data;
          public void setData(List&lt;T&gt; data){
              this.data=data;
          }
      }
  </code></pre>
  
  <p>Then in my caller class I have:</p>
  
  <pre><code>    public class B{
          private A a;
  
          public void apply(A a, List&lt;D&lt;String&gt;&gt; list){
              a.setData(list); //It shows an error
          }
      }
  </code></pre>
  
  <p>It is showing the following error: </p>
  
  <blockquote>
    <p><code>List&lt;String&gt;</code> cannot be converted to <code>List&lt;?&gt;</code></p>
  </blockquote>
  
  <p>My understanding of unknown type was it should allow something basic like this. They are both java.util.List</p>
  
  <p>Can someone explain why this is the case and what is the workaround?</p>