title: Unexpected behaviour with generics
body: <p>I'm facing this error while work with Java generics, and I don't understand which is the problem;<br>
  I have two classes like these:</p>
  <pre><code>public abstract class BaseClass{
     ....
  }
  
  public class OneClass extends BaseClass{
     ....
  }
  </code></pre>
  <p>I have a generic repo for OneClass:</p>
  <pre><code>public class MyRepo&lt;T extends BaseClass&gt;{
     List&lt;T&gt; getElements();
  }
  </code></pre>
  <p>Then I have a method that should works whit generics:</p>
  <pre><code>private MyRepo&lt;OneClass&gt; myRepo;   
  
  public &lt;T extends BaseClass&gt; List&lt;T&gt; myMethod(){
       return myRepo.getElements();
  }
  </code></pre>
  <p>The method doesn't work unless I force a cast to List ( as shown below ):</p>
  <pre><code>public &lt;T extends BaseClass&gt; List&lt;T&gt; myMethod(){
     return  (List&lt;T&gt;)  myRepo.getElements();
  }
  </code></pre>
  <p>I don't understand which is the problem given that OneClass extends BaseClass.<br>
  Thanks for any suggestion.</p>