I have two lists, let's say:
def list1 = ["ABC", "DEF", "GHI", "JKL"]
def list2 = ["ABC", "DEF", "JKL", "GHI"]
I want to compare these two lists and make sure that the values they have are the same, despite the order in which they appear.
I've tried this but it doesn't seem to work:
assert new HashSet( Arrays.asList(list1)).equals(new HashSet( Arrays.asList(list2)))
Could anyone point me in the right direction? Much appreciated.