title: Comparing Two ArrayLists to Get Unique and Duplicate Values
body: <p>I have two <code>ArrayLists</code> as shown - <code>pinklist</code> and <code>normallist</code>.  I am comparing both of them and finding the unique and duplicate values from both as shown below in code:</p>
  
  <pre><code>List&lt;String&gt; pinklist = t2.getList();
  List&lt;String&gt; normallist = t.getList();
  ArrayList&lt;String&gt; duplicatevalues = new ArrayList&lt;String&gt;();
  ArrayList&lt;String&gt; uniquevalues = new ArrayList&lt;String&gt;();
  
  for (String finalval : pinklist) {
      if (pinklist.contains(normallist)) {
          duplicatevalues.add(finalval);
      } else if (!normallist.contains(pinklist)) {
          uniquevalues.add(finalval);
      }
  }
  </code></pre>
  
  <p>I am getting the <code>duplicateValues</code> properly, but I am not getting the unique values.</p>