title: Which Java structure better to use? I need good performance, non-fixed size, and ease to clone / copy
body: <p>I'd like to have a data structure with a good performance which allows easy clone/copy from one structure to another. My flow looks like this:</p>
  
  <ul>
  <li>Take <code>list1</code>, full of objects.</li>
  <li>Iterate over the objects, create from each object several objects of the same type, and add them into <code>list2</code>.</li>
  <li>Erase all objects from <code>list1</code> and add all objects from <code>list2</code> into <code>list1</code>. </li>
  <li>Erase all objects from <code>list2</code>.</li>
  </ul>
  
  <p>I'm stuck to choose a data structure, for the moment I use <code>ArrayDeque</code>, which is not very fast. The number of objects is not fixed, so maybe array is not a good choice.
  Any advice please? Here is my code : </p>
  
  <pre><code>ArrayDeque&lt;Obj&gt; list1 = new ArrayDeque(),
  list2 = new ArrayDeque();
  
  // Iterate over list1 
  // and add() objects into list2 
  
  list1 = list2.clone();
  list2.clear();
  </code></pre>
  
  <p>Thank you !</p>