title: Fastest way to copy one array list to another
body: <p>I came across a question related to ArrayList of java in a company written test. My query is just a small part of the actual question. </p>
  
  <p>Lets say we have the following function to copy one ArrayList to another:</p>
  
  <pre><code>void function(List&lt;E&gt; l)
  {
      List&lt;E&gt; m = new ArrayList&lt;E&gt;(l);
  }
  </code></pre>
  
  <p>The question basically asks to optimize this copy operation. The List may contain a million entries. I have tried the following approaches:</p>
  
  <p>Collections.copy</p>
  
  <p>System.Arraycopy</p>
  
  <p>addAll </p>
  
  <p>But all of these seem to be slower than the given method. I need a method that is faster than the given method or is it the best method that is available?</p>