9
I want to add the items from a list to another list without any duplicates. I've used the method below involving a set. Is this the most efficient way to achieve the end result? Is there a neater way of updating lista to contain the unique setboth objects?
Set setboth = new HashSet(lista);
setboth.addAll(listb);
lista.clear();
lista.addAll(setboth);