title: Replace one array list with other list
body: <p>In my business logic, I want to replace one list completely with another list.</p>
  
  <p>Is the below approach correct?</p>
  
  <pre><code>public class TestListReplacement {
  
      public static void main(String[] args) {
  
          List&lt;String&gt; values= new ArrayList&lt;String&gt;();
          values.add("a");
          values.add("b");
          values.add("c");
          values.add("d");
          values.add("e");
          values.add("f");
  
          List&lt;String&gt; valuesNew= new ArrayList&lt;String&gt;();
          valuesNew.add("g");
          valuesNew.add("h");
          valuesNew.add("i");
          valuesNew.add("j");
          valuesNew.add("k");
  
          values= valuesNew;
          for(String val:values){
              System.out.println(val);
          }
      }
  }
  </code></pre>
  
  <p>This seems to work fine, but I want to know if in some use cases, it might not work.</p>