Comparing an element in two different List that are different objects
<p>I will post my code, but just change the names. I'll add comments when I can add more info. </p>

<pre><code>List&lt;AbstractA&gt; foo = bar.getFoo; // This returns an ArrayList&lt;E&gt; with two objects. Each object has an ID and Price. 

List&lt;Name&gt; names = null;
try{
   names = someClass.getNames(); // This returns an ArrayList&lt;E&gt; with 10 Name objects. Each one has an ID, name, description
}catch(Exception e){
   Log.warn(e);
}
</code></pre>

<p>My main goal is compare the two lists. I have...</p>

<pre><code>Iterator&lt;Name&gt; object = names.iterator();
while(object.hasNext()){
   Name j = object.next(); // assign next name
   System.out.println("j.getId(): " + j.getId()); // This provides me the Id
   System.out.println("foo.contains(j.getId()) " + foo.contains(j.getId())); // Keeps spitting out false but I want it to be true

   if(foo.contains(j.getId())){
      object.remove(); //remove name out of Names list
   }
}
</code></pre>

<p>I'm not sure if this makes a lot of sense of what I am trying to do. 
There are two beans in this program representing foo and name. So they are different objects and I think that may be the issue. </p>

<p>Any suggestions? Sorry if this is VERY vague...</p>

<p>My main question is, if I want to compare an element in these two Lists, what is the best way to do this?</p>
