title: Combining ArrayList without duplicates
body: <pre><code>import java.util.ArrayList;
  import java.util.Collections;
  
  public class SmartCombining {
      public static void main(String[] args) {
          ArrayList&lt;Integer&gt; list1 = new ArrayList&lt;Integer&gt;();
          ArrayList&lt;Integer&gt; list2 = new ArrayList&lt;Integer&gt;();
  
          Collections.addAll(list1, 4, 3);
          Collections.addAll(list2, 5, 10, 4, 3, 7);
  
          smartCombine(list1, list2);
          System.out.println(list1);
          System.out.println(list2);
      }
  
      public static void smartCombine(ArrayList&lt;Integer&gt; first,
              ArrayList&lt;Integer&gt; second) {
          first.addAll(second);
      }    
  }
  </code></pre>
  
  <p>So, I want to combine two lists into one, but if the second list contains a number from the first it won't be added. So far my method adds them all together.</p>