### Question:
CollectionUtils { public static boolean mapEquals(Map<?, ?> map1, Map<?, ?> map2) { if (map1 == null && map2 == null) { return true; } if (map1 == null || map2 == null) { return false; } if (map1.size() != map2.size()) { return false; } for (Map.Entry<?, ?> entry : map1.entrySet()) { Object key = entry.getKey(); Object value1 = entry.getValue(); Object value2 = map2.get(key); if (!objectEquals(value1, value2)) { return false; } } return true; } private  CollectionUtils(); @SuppressWarnings({"unchecked", "rawtypes"}) static List<T> sort(List<T> list); static List<String> sortSimpleName(List<String> list); static Map<String, Map<String, String>> splitAll(Map<String, List<String>> list, String separator); static Map<String, List<String>> joinAll(Map<String, Map<String, String>> map, String separator); static Map<String, String> split(List<String> list, String separator); static List<String> join(Map<String, String> map, String separator); static String join(List<String> list, String separator); static boolean mapEquals(Map<?, ?> map1, Map<?, ?> map2); static Map<String, String> toStringMap(String... pairs); @SuppressWarnings("unchecked") static Map<K, V> toMap(Object... pairs); static boolean isEmpty(Collection<?> collection); static boolean isNotEmpty(Collection<?> collection);  }### Answer:
@Test public void mapEquals() throws Exception { Map<String, Integer> mapA = null; Map<String, Integer> mapB = null; Assert.assertTrue(CollectionUtils.mapEquals(mapA, mapB)); mapA = new ConcurrentHashMap<String, Integer>(); Assert.assertFalse(CollectionUtils.mapEquals(mapA, mapB)); mapB = new Hashtable<String, Integer>(); Assert.assertTrue(CollectionUtils.mapEquals(mapA, mapB)); mapA.put("sxp", 18); Assert.assertFalse(CollectionUtils.mapEquals(mapA, mapB)); mapB.put("wf", 19); Assert.assertFalse(CollectionUtils.mapEquals(mapA, mapB)); mapB.put("sxp", 18); Assert.assertFalse(CollectionUtils.mapEquals(mapA, mapB)); mapA.put("wf", 19); Assert.assertTrue(CollectionUtils.mapEquals(mapA, mapB)); }