title: Union of two lists containing objects
body: <p>I have two list </p>
  
  <pre><code>ListA&lt;TestData&gt; listA = new ArrayList&lt;TestData&gt;()
  ListB&lt;TestData&gt; listB = new ArrayList&lt;TestData&gt;() 
  </code></pre>
  
  <p>both contain object of type TestData and TestData contain these variables.</p>
  
  <pre><code>TestData {
      String status;
      String billType;
  } 
  </code></pre>
  
  <p>I want union of the two lists.</p>
  
  <pre><code>ListA = ["ACTV","S"],["DISC","E"];
  
  ListB = ["ACTV","V"],["DISC","E"],["DISC","S"];
  
  UpdatedList = ["ACTV","S"],["DISC","E"],["ACTV","V"],["DISC","S"];
  </code></pre>
  
  <p>I tried by checking below condition but it is not working.</p>
  
  <pre><code>for (TestData myData : ListA) {
          if(!ListB.contains(myData))
              return true;
      }
  </code></pre>
  
  <p>Can you please let me know the correct and efficient way to merge the list. or this can be achievable my using some other collection.</p>