title: Java: Why does an ArrayList with a referred generic type not count as the cast when calling .readObject()?
body: <p>I am loading an <code>ArrayList</code> from a save file which has a generic type inferred, but eclpise is telling me I haven't checked the cast, why doesn't <code>(ArrayList&lt; TypeOfObject &gt;)</code> count as a cast when <code>(TypeOfObject)</code> does?</p>
  
  <pre><code>    game.evilSprites = (ArrayList&lt;EvilSprite&gt;) OIS.readObject();
  </code></pre>
  
  <p>casting the object as an evilSprite works...</p>
  
  <pre><code>    game.evilSprite = (EvilSprite) OIS.readObject();
  </code></pre>
  
  <p>EDIT: great, thank you, so it is at least a valid cast, how do I check it to remove the warning?</p>