title: Enqueue List method
body: <p>Is there a way to enqueue this method faster? I'm trying to add performance test to this method and wondering if there is alternative for this.</p>
  
  <pre><code>  import java.util.ArrayList;
    import java.util.List;
    import java.util.NoSuchElementException;
  
    public class ImmutableQueueImpl&lt;E&gt; implements ImmutableQueue&lt;E&gt; {
        private     List&lt;E&gt; queue;
        public ImmutableQueueImpl() { 
          queue = new ArrayList&lt;E&gt;();
        }
  
        private ImmutableQueueImpl(List&lt;E&gt; queue) {
          this.queue = queue; }
  
        @Override
        public ImmutableQueue&lt;E&gt; enqueue(E e) {
          if (e == null) {
           throw new IllegalArgumentException();
          }
          List&lt;E&gt; clone = new ArrayList&lt;E&gt;(queue); clone.add(e);
          return new ImmutableQueueImpl&lt;E&gt;(clone);
        }
  
        @Override
        public ImmutableQueue&lt;E&gt; dequeue() {
           if (queue.isEmpty()) {
              throw new NoSuchElementException();
           }
           List&lt;E&gt; clone = new ArrayList&lt;E&gt;(queue); 
           clone.remove(0);
           return new ImmutableQueueImpl&lt;E&gt;(clone);
        }
  
        @Override 
        public E peek() {
          if (queue.isEmpty()) {
            throw new NoSuchElementException();
          }
          return queue.get(0); 
        }
  
       @Override 
       public int size() {
        return queue.size();
       }
      }
  </code></pre>
  
  <p><strong>EDIT</strong>
     I have added the full code for reference. Hope that helps</p>