title: java.util.Vector cannot be cast to java.util.ArrayList - cast List to ArrayList
body: <p>I have following code</p>
  
  <pre><code>public List&lt;Item&gt; getDbItems()
      {
          ArrayList&lt;Item&gt; dbItems = new ArrayList&lt;&gt;();
          EntityTransaction entr=em.getTransaction();
              entr.begin();
          TypedQuery&lt;Item&gt; query = em.createQuery("SELECT i FROM Item i", Item.class);
          dbItems = (ArrayList&lt;Item&gt;) query.getResultList();
          em.getTransaction().commit();
          return dbItems;
      }
  </code></pre>
  
  <p>And I need it to return the ArrayList instead of the Array. Is there an query that returns ArrayList?</p>