I have two Pojo Classes on with different field with unique ID.
I want to perform intersection of two List<A>
and List<B>
.
What is best way to do. One is i can simply iterate twice and but then the complexity is too high n2.
is any better way to do that ? Can i Do it with Comparator?
Class A {
Id, Name ,DOB}
Class B{
id, aid ,location }
I have list of A , and List of B
now want to get list of A with location in B