title: Passing ArrayList<Subclass> to method declared with List<Superclass>
body: <p>I have a method with a parameter containing generics.</p>
  
  <pre><code>public static void readList(List&lt;ModelObject&gt; list)
  {
      // more code
  }
  </code></pre>
  
  <p>I want to pass an <code>ArrayList</code> of <code>ModelObjectImplementation</code>s to this method.</p>
  
  <pre><code>ArrayList&lt;ModelObjectImplementation&gt; myList;
  myList = ...
  
  readList(myList); // gives compilation error
  </code></pre>
  
  <p><code>ModelObject</code> is an interface that <code>ModelObjectImplementation</code> implements. How can I change the method declaration to allow this?</p>