Hello I am using selenium with java. I have to compare lists and return the difference.These values i am fetching from the database
List A has IDs and Income Tax, List B has Ids and Income tax.
I want to compare List A Ids with List B Ids and List A Income tax with List B Income tax. After compare I want to return the difference.i,e
Example :If IDS in List A [1,2,3] and Income Tax in List A are [10.25,1.58,30.28]
Ids in List B[1,2,3] and Income Tax in List B are [10.25,1.57,28.28]
I want to display which values are different after comparison and also for which IDs its different
I want output as Income tax is different for Ids 2 and 3.
For comparing the lists I tried the below code
try {
IDList.equals(AfterChangeIDList);
log.info("ID List are equal");
}catch (Exception e) {
log.warn("IDList are not equal");
throw e;
}
//Compare Income tax lists
try {
IncomeTaxList.equals(AfterChangeIncomeTaxList);
log.info("Income Tax list are equal");
}catch (Exception e) {
log.warn("Income Tax list are not equal");
throw e;
}
May I know how to return the difference?