I think this does not work. You need to check equals on each element of the array. You can use Arrays#deepEquals(...)