I have two ArrayList<Object> and I want to be able to compare the differences. At the moment, I have a mediocre way of solving. In a perfect world I have two list next to each other and the differences listed in red or something like that.
Below is the code I'm using. This determines whether there are pinDifferences as a flag and a string. The string and flag are then passed to a jsp to print out. (This is in a service.) The problem I'm running into is if the pins are identical (1-17) but the second one has two options for pin #3. I'm printing out that pin 3-18 are different. Because I've sorted it. What I want to do is show that pin #3 doesn't exist on the other connector. This case could happen both ways and multiple times. Would there be a efficient way to compare two ArrayList<Object> and list out the similarities and and differences. Kind of like what gitHub does with merge conflicts.
So, the important part is from code lines 21-50. I compare every characteristic about the individual objects. I just build a string of the differences and tag it to the seekerId. This will work for 90% of the data, but it's a remedial way to do. I pass the pinDifferenceDetails to a jsp and print accordingly. Personally, I want to have the text "Pin Differences Exist" as a link to a separate page with a beautiful table that display similarities and differences. I hope I explained myself cleanly.
Thanks for your help!