title: Why does ArrayList<E> constructor allow a raw ArrayList parameter
body: <p>Why does this code compile:</p>
  
  <pre><code>ArrayList strings = new ArrayList();
  strings.add("s1");
  strings.add("s2");
  
  ArrayList&lt;Integer&gt; numbers = new ArrayList&lt;Integer&gt;(strings);
  </code></pre>
  
  <p>Given that the constructor in question expects a <code>Collection&lt;? extends E&gt;</code> where <code>E</code> in this case is Integer? How are objects contained in the raw type <code>ArrayList</code> a subclass of <code>E</code>? Or is there some hidden compiler magic that allows this for legacy purposes?</p>