Convert the lists to sets before comparing them :
new HashSet( Arrays.asList( a1 )).equals( new HashSet( Arrays.asList( a2 ) ));
Alternatively, you can sort the arrays using Arrays.sort()
but that might break code which depends on the order of the elements in the arrays.