title: Not able to create a map with generic class as key and a list of generic type objects as value
body: <p>I am trying to construct a hashmap of class (key) to the list of tasks (value) for that particular class. Here's my code:</p>
  <pre><code>public class StaticTaskListProvider&lt;TEntity extends ScannableEntity&gt; {
  
      private final Class&lt;TEntity&gt; entityType;
      private static Map&lt;Class&lt;? extends ScannableEntity&gt;, List&lt;Task&lt;? extends ScannableEntity&gt;&gt;&gt; entityToTaskListMap;
  
      public StaticTaskListProvider(Class&lt;TEntity&gt; entityType) {
          this.entityType = entityType;
          initializeMap();
      }
  
      private void initializeMap() {
          entityToTaskListMap = new HashMap&lt;&gt;();
          entityToTaskListMap.put(EntityA.class, entityATaskList());
                                                 ^^^^^^^^^^^^^^^^^^
      }
  
      private List&lt;Task&lt;EntityA&gt;&gt; entityATaskList() {
          List&lt;Task&lt;EntityA&gt;&gt; entityATaskList = new ArrayList&lt;&gt;();
          entityATaskList.add(new NewTask());
          return entityATaskList;
      }
  </code></pre>
  <p>But I am getting the following error while trying to add the <code>List&lt;Task&lt;EntityA&gt;</code> to the map even though the <code>EntityA extends ScannableEntity</code>.</p>
  <pre><code> error: incompatible types: List&lt;Task&lt;EntityA&gt;&gt; cannot be converted to List&lt;Task&lt;? extends ScannableEntity&gt;&gt;
          entityToTaskListMap.put(EntityA.class, entityATaskList());
                                                               ^
  </code></pre>