title: Return list of subtype object from extended list of supertype
body: <p>I declared list which contains elements of <code>ClassA</code>:</p>
  
  <pre><code>public class SuperList&lt;E&gt; extends ArrayList&lt;ClassA&gt; {
  
    public SuperList&lt;E&gt; getSomeElements() {
      SuperList&lt;E&gt; resultList = new SuperList&lt;&gt;();
      // creating result list
      return resultList;
    }
  }
  </code></pre>
  
  <p>I have a class <code>ClassB</code>:</p>
  
  <pre><code>public class ClassB extends ClassA  {
    // class definition
  }
  </code></pre>
  
  <p>And finally I have <code>SuperList</code> with instances of ClassB. I want to get elements from it by method <code>getSomeElements()</code> and iterate over it:</p>
  
  <pre><code>SuperList&lt;ClassB&gt; bigList;
  
  SuperList&lt;ClassB&gt; elements = bigList.getSomeElements();
  for(ClassB element : elements){
    // do something
  }
  </code></pre>
  
  <p>But IntelIJ says something like that:</p>
  
  <blockquote>
    <p>Incompatibile types. Required: ClassB. Found: ClassA.</p>
  </blockquote>
  
  <p>Can I do it properly?</p>