I need to compare two files with same tags, but they have some different values and I need to print three lists:
Set<Costo> list1 = read.getCostos("path1");
Set<Costo> list2 = read.getCostos("path2");
Set<Costo> list3 = ListaCostoUtil.listaConjunta(list1, list2);
Set<Costo> plus = ListaCostoUtil.listaComplementoMenos(list3, list2);
Set<Costo> minus = ListaCostoUtil.listaComplementoMas(list3, list2);
where list1
is my first XML file and list2
is the other, I need to print a list3
where is a complete list of all the elements from list1
and list2
.
With list plus I just need to compare my list3
with list2
and throw all the elements that are not on list2
with a "+" and it's the same with minus but just adding a "-", how could I start doing it? thanks