I am attempting to generate an ArrayList by merging two other lists. I am allowed duplicate objects, however my resulting ArrayList must contain the difference between both initial lists. I realize this may sound convoluted, so here is an example:
ArrayList 1: [obj1, obj1, obj1, obj2, obj4, obj4]
ArrayList 2: [obj1, obj2, obj2, obj3]
Resulting ArrayList: [obj1, obj1, obj2, obj3, obj4, obj4]
I feel like this should be simple but I cannot seem to figure it out. I would use ArrayList1.removeAll(ArrayList2), however each object has its' own individual ID so I don't think I would detect that they are the same object.
EDIT: fixed an error in my resulting ArrayList
Thanks!