I was surprised to learn that junit has a magic assertEquals specifically for Object[] assertEquals(Object[], Object[]) but that is obviously a bad idea and junit eventually deprecated it. https://junit.org/junit4/javadoc/4.12/org/junit/Assert.html#assertEquals(java.lang.Object[], java.lang.Object[]) Follow their lead and rename your method to assertArrayEquals
124 static void assertEquals(Object[] actual, Object[] expected) {