I feel like there most likely is a java library function to do this, and possibly another question on StackOverflow similar to this, but I couldn't find anything in my preliminary search.
I have two java.util.List objects, ListA and ListB. I want to use ListB, which is larger than ListA, to modify my elements in ListA. In order to do this, I need to match an ID from ListA to its corresponding element in ListB (my prior code ensures that every element in ListA will be in ListB) and then use a field in ListB to modify ListA.
Is a Hash function the best way to do this? or is there a better way?
EDIT: The two lists don't have the same type of objects
hashCodeandequalson that object using theidfield, and useindexOfto find A objects in the list.