### Question:
ArrayUtils { public static boolean arrayFriendlyEquals(Object o1, Object o2) { if (o1 instanceof byte[] && o2 instanceof byte[]) { return Arrays.equals(((byte[]) o1), (byte[]) o2); } else if (o1 instanceof char[] && o2 instanceof char[]) { return Arrays.equals(((char[]) o1), (char[]) o2); } else if (o1 instanceof boolean[] && o2 instanceof boolean[]) { return Arrays.equals(((boolean[]) o1), (boolean[]) o2); } else if (o1 instanceof long[] && o2 instanceof long[]) { return Arrays.equals(((long[]) o1), (long[]) o2); } else if (o1 instanceof double[] && o2 instanceof double[]) { return Arrays.equals(((double[]) o1), (double[]) o2); } else if (o1 instanceof int[] && o2 instanceof int[]) { return Arrays.equals(((int[]) o1), (int[]) o2); } else if (o1 instanceof short[] && o2 instanceof short[]) { return Arrays.equals(((short[]) o1), (short[]) o2); } else if (o1 instanceof float[] && o2 instanceof float[]) { return Arrays.equals(((float[]) o1), (float[]) o2); } else if (o1 instanceof Object[] && o2 instanceof Object[]) { return Arrays.equals(((Object[]) o1), (Object[]) o2); } else return o1.equals(o2); } 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 shouldCorrectlyCheckEquality() { assertTrue(arrayFriendlyEquals(new byte[]{1, 2}, new byte[]{1, 2})); assertTrue(arrayFriendlyEquals(new char[]{1, 2}, new char[]{1, 2})); assertTrue(arrayFriendlyEquals(new boolean[]{true, false}, new boolean[]{true, false})); assertTrue(arrayFriendlyEquals(new long[]{1, 2}, new long[]{1, 2})); assertTrue(arrayFriendlyEquals(new double[]{1, 2}, new double[]{1, 2})); assertTrue(arrayFriendlyEquals(new int[]{1, 2}, new int[]{1, 2})); assertTrue(arrayFriendlyEquals(new short[]{1, 2}, new short[]{1, 2})); assertTrue(arrayFriendlyEquals(new float[]{1, 2}, new float[]{1, 2})); assertTrue(arrayFriendlyEquals(new String[]{"1", "2"}, new String[]{"1", "2"})); assertTrue(arrayFriendlyEquals(new Object[]{"1", 2}, new Object[]{"1", 2})); assertTrue(arrayFriendlyEquals("2", "2")); assertTrue(arrayFriendlyEquals(2, 2)); assertFalse(arrayFriendlyEquals(new byte[]{1, 3}, new byte[]{1, 2})); assertFalse(arrayFriendlyEquals(new char[]{1, 3}, new char[]{1, 2})); assertFalse(arrayFriendlyEquals(new boolean[]{false, false}, new boolean[]{true, false})); assertFalse(arrayFriendlyEquals(new long[]{1, 2}, new int[]{1, 2})); assertFalse(arrayFriendlyEquals(new double[]{1, 2}, new float[]{1, 2})); assertFalse(arrayFriendlyEquals(new int[]{1, 2}, new byte[]{1, 2})); assertFalse(arrayFriendlyEquals(new int[]{1, 2}, new short[]{1, 2})); assertFalse(arrayFriendlyEquals(new float[]{1, 2}, new Float[]{new Float(1.0), new Float(2.0)})); assertFalse(arrayFriendlyEquals(new Object[]{"1", "2"}, new Object[]{"1", 2})); assertFalse(arrayFriendlyEquals("2", "3")); assertFalse(arrayFriendlyEquals(2, 3)); }