title: Convert an ArrayList to an object array
body: <p>Is there a command in java for conversion of an ArrayList into a object array. I know how to do this copying each object from the arrayList into the object array, but I was wondering if would it be done automatically.</p>
  
  <p>I want something like this:</p>
  
  <pre><code>ArrayList&lt;TypeA&gt; a;
  
  // Let's imagine "a" was filled with TypeA objects
  
  TypeA[] array = MagicalCommand(a);
  </code></pre>