title: How replace one list items with another in java?
body: <p>I have two array lists, Can it possible to replace the one list items with the second list.</p>
  
  <pre><code>ArrayList&lt;String&gt; a = new ArrayList&lt;String&gt;();
  ArrayList&lt;String&gt; b = new ArrayList&lt;String&gt;();
  a.add("testone");
  a.add("testtwo");
  a.add("testthree");
  b.add("demoone");
  b.add("demotwo");
  System.out.println("List values are: "+ a);
  </code></pre>
  
  <p>Is there any way to replace the first list with the second list elements. So if I print first array list, it should print the following output</p>
  
  <pre><code>[demoone, demotwo] 
  </code></pre>