### Question:
ArrayUtils { public static <T> boolean arrayFriendlyMapEquals(Map<String, T> map1, Map<String, T> map2) { if (map1.size() != map2.size()) return false; try { for (Map.Entry<String, T> e : map1.entrySet()) { String key = e.getKey(); Object value = e.getValue(); if (value == null) { if (!(map2.get(key) == null && map2.containsKey(key))) return false; } else { if (!arrayFriendlyEquals(value, map2.get(key))) return false; } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; } 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 equalMapsShouldBeEqual() { assertTrue(arrayFriendlyMapEquals(singletonMap("key", (Object) "value"), singletonMap("key", (Object) "value"))); assertFalse(arrayFriendlyMapEquals(singletonMap("key", (Object) "value2"), singletonMap("key", (Object) "value"))); assertTrue(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", new int[]{1, 2}), Collections.<String, Object>singletonMap("key", new int[]{1, 2}))); assertFalse(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", new int[]{1, 3}), Collections.<String, Object>singletonMap("key", new int[]{1, 2}))); assertFalse(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", new int[]{1, 3}), Collections.<String, Object>emptyMap())); assertFalse(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", new int[]{1, 3}), Collections.<String, Object>singletonMap("key", null))); assertFalse(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", null), Collections.<String, Object>singletonMap("key", new int[]{1, 3}))); assertTrue(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key", null), Collections.<String, Object>singletonMap("key", null))); assertFalse(arrayFriendlyMapEquals(Collections.<String, Object>singletonMap("key2", new int[]{1, 2}), Collections.<String, Object>singletonMap("key", new int[]{1, 2}))); }