title: Copying an ArrayList
body: <p>I have an ArrayList of generic object type, i.e. List queue. I want to write a function EnqueueModified, that takes an arraylist and a list object as input and returns another ArrayList that contains the elments of the old arraylist and the list object but without affecting the original arraylist passed. i.e. Enqueue operation should be performed on a new copy of the arraylist and returned.</p>
  
  <p>This can be done as follows:</p>
  
  <pre><code>    public List&lt;E&gt; EnqueueModified(E e, List&lt;E&gt; queue) {
      List&lt;E&gt; clone = new ArrayList&lt;E&gt;(queue);
      clone.add(e);
      return clone;
  </code></pre>
  
  <p>} </p>
  
  <p>but is there a better method to do this? instead of using a copy constructor, is there any faster way to create a copy of the list? I cannot use cloning as it does not support for generic List.</p>