title: efficient way to do 'contains' between two lists
body: <p>I have 2 lists of integers,</p>
  
  <pre><code>l1 = new ArrayList();
  l2 = new ArrayList();
  </code></pre>
  
  <p>I want to find out duplicate items in both of them, I have my usual approach:-</p>
  
  <pre><code>for (Integer i : l1)
  {
   if(l2.contains(i)){
      System.out.println("Found!");
    } 
  }
  </code></pre>
  
  <p>I've heard <code>contains()</code> is <code>O(n)</code>, making my implementation <code>O(n^2)</code>.  </p>
  
  <p>Is there a better way to do this, (less than <code>O(n^2)</code>) ?</p>