Java - How to find matching objects between two lists?

Do the objects you want to look at implement equals(Object) and hashCode() that only take into account the fields you care about. If so, you can create a new HashSet from the first list, and then call retainAll() passing in the second list.

Rather than use the String repesntation, use the equals() method a HashSet as so.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions