I\'ve been looking for a method that operates like Arrays.equals(a1, a2), but ignoring the element order. I haven\'t been able to find it in either Google Colle
Arrays.equals(a1, a2)
This is three method calls and uses Google CollectionsGuava, but is possibly as simple as it gets:
HashMultiset.create(c1).equals(HashMultiset.create(c2));
Creating the temporary Multisets may appear wasteful, but to compare the collections efficiently you need to index them somehow.
Multiset