I can't get the Union of two arrayLists
<pre><code>public static &lt;E&gt; ArrayList&lt;E&gt; union
        (ArrayList&lt;E&gt;array1, ArrayList&lt;E&gt;array2)
{
  //arrayUnion will be the arrayList that will be returned
  ArrayList &lt;E&gt; arrayUnion  = new ArrayList &lt;E&gt;(array1);   
  arrayUnion.addAll(array2);
  E current;

  for(int i = 0; i &lt; arrayUnion.size(); i++)
  {
      for(int j = 0; j &lt; arrayUnion.size(); j++)
      {
          current = arrayUnion.get(i);
          if(current.equals(arrayUnion.get(j)))
          {
              arrayUnion.remove(j);
          }
      }
  }

      return arrayUnion;
}
</code></pre>

<p>For my test of this method, this was the output:</p>

<blockquote>
  <p>The first list is [ww, ee, rr, t, yy] </p>
  
  <p>The second list is [ww, ss, ee, dd] </p>
  
  <p>The union of both ArrayLists is: [ee, t, ww, dd]</p>
</blockquote>

<p>What went wrong..? I've been stuck on this for far too long and I never want to hear the word Union again. Plz help</p>
