title: Converting an untyped Arraylist to a typed Arraylist
body: <p>Is there a more elegant solution to convert an '<code>Arraylist</code>' into a '<code>Arraylist&lt;Type&gt;</code>'?</p>
  
  <p>Current code:</p>
  
  <pre><code>ArrayList productsArrayList=getProductsList();
  ArrayList&lt;ProductListBean&gt; productList = new ArrayList&lt;ProductListBean&gt;();
  
  for (Object item : productsArrayList)
  {
    ProductListBean product = (ProductListBean)item;
    productList.add(product);
  }
  </code></pre>