### Question:
ArrayUtils { public static int arrayFriendlyHashCode(Object o) { if (o instanceof byte[]) { return Arrays.hashCode((byte[]) o); } else if (o instanceof char[]) { return Arrays.hashCode((char[]) o); } else if (o instanceof boolean[]) { return Arrays.hashCode((boolean[]) o); } else if (o instanceof long[]) { return Arrays.hashCode((long[]) o); } else if (o instanceof double[]) { return Arrays.hashCode((double[]) o); } else if (o instanceof int[]) { return Arrays.hashCode((int[]) o); } else if (o instanceof short[]) { return Arrays.hashCode((short[]) o); } else if (o instanceof float[]) { return Arrays.hashCode((float[]) o); } else if (o instanceof Object[]) { return Arrays.hashCode((Object[]) o); } return o.hashCode(); } private  ArrayUtils(); static boolean isPrimitiveArray(Object o); static boolean isPrimitiveOrStringArray(Object o); static boolean isArray(Object o); static boolean arrayFriendlyEquals(Object o1, Object o2); static int arrayFriendlyHashCode(Object o); static String primitiveOrStringArrayToString(Object o); static boolean arrayFriendlyMapEquals(Map<String, T> map1, Map<String, T> map2);  }### Answer:
@Test public void equalArraysShouldHaveEqualHasCodes() { assertEquals(arrayFriendlyHashCode(new byte[]{1, 2}), arrayFriendlyHashCode(new byte[]{1, 2})); assertEquals(arrayFriendlyHashCode(new char[]{1, 2}), arrayFriendlyHashCode(new char[]{1, 2})); assertEquals(arrayFriendlyHashCode(new boolean[]{true, false}), arrayFriendlyHashCode(new boolean[]{true, false})); assertEquals(arrayFriendlyHashCode(new long[]{1, 2}), arrayFriendlyHashCode(new long[]{1, 2})); assertEquals(arrayFriendlyHashCode(new double[]{1, 2}), arrayFriendlyHashCode(new double[]{1, 2})); assertEquals(arrayFriendlyHashCode(new int[]{1, 2}), arrayFriendlyHashCode(new int[]{1, 2})); assertEquals(arrayFriendlyHashCode(new short[]{1, 2}), arrayFriendlyHashCode(new short[]{1, 2})); assertEquals(arrayFriendlyHashCode(new float[]{1, 2}), arrayFriendlyHashCode(new float[]{1, 2})); assertEquals(arrayFriendlyHashCode(new String[]{"1", "2"}), arrayFriendlyHashCode(new String[]{"1", "2"})); assertEquals(arrayFriendlyHashCode(new Object[]{"1", 2}), arrayFriendlyHashCode(new Object[]{"1", 2})); assertEquals(arrayFriendlyHashCode("2"), arrayFriendlyHashCode("2")); assertEquals(arrayFriendlyHashCode(2), arrayFriendlyHashCode(2)); assertNotSame(arrayFriendlyHashCode(new byte[]{1, 3}), arrayFriendlyHashCode(new byte[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new char[]{1, 3}), arrayFriendlyHashCode(new char[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new boolean[]{false, false}), arrayFriendlyHashCode(new boolean[]{true, false})); assertNotSame(arrayFriendlyHashCode(new long[]{1, 2}), arrayFriendlyHashCode(new int[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new double[]{1, 2}), arrayFriendlyHashCode(new float[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new int[]{1, 2}), arrayFriendlyHashCode(new byte[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new int[]{1, 2}), arrayFriendlyHashCode(new short[]{1, 2})); assertNotSame(arrayFriendlyHashCode(new float[]{1, 2}), arrayFriendlyHashCode(new Float[]{new Float(1.0), new Float(2.0)})); assertNotSame(arrayFriendlyHashCode(new Object[]{"1", "2"}), arrayFriendlyHashCode(new Object[]{"1", 2})); assertNotSame(arrayFriendlyHashCode("2"), arrayFriendlyHashCode("3")); assertNotSame(arrayFriendlyHashCode(2), arrayFriendlyHashCode(3)); }