title: Java - InvocationTargetException when casting List to ArrayList
body: <p>Say a class is defined like: </p>
  
  <pre><code>public class foodFactory{
  
      protected EList&lt;food&gt; Basket;
  
      public List&lt;food&gt; getBasket(){
          return Basket;
      }
  }
  </code></pre>
  
  <p>The following throws exeption when I try to run it: </p>
  
  <pre><code>foodFactory factory = new foodFactory();
  
  ArrayList&lt;food&gt; foodbasket;
  
  foodbasket = (ArrayList&lt;food&gt;)getBasket();
  </code></pre>
  
  <p>And I'm not seeing why. Did I not cast it properly? </p>