### Question:
ConfigurationUtils { @SuppressWarnings("unchecked") public static Map<String, Object> deepMerge(Map<String, Object> a, Map<String, Object> b) { Map<String, Object> result = new LinkedHashMap<>(a != null ? a : Collections.emptyMap()); for (String k : b.keySet()) { Object av = result.get(k); Object bv = b.get(k); Object o = bv; if (av instanceof Map && bv instanceof Map) { o = deepMerge((Map<String, Object>) av, (Map<String, Object>) bv); } if (result.containsKey(k)) { result.replace(k, o); } else { result.put(k, o); } } return result; } private  ConfigurationUtils(); @SuppressWarnings("unchecked") static boolean has(Map<String, Object> m, String[] path); static Object get(Map<String, Object> m, String... path); @SuppressWarnings("unchecked") static Object get(Map<String, Object> m, int depth, String... path); @SuppressWarnings("unchecked") static void set(Map<String, Object> a, Object b, String... path); @SuppressWarnings("unchecked") static void delete(Map<String, Object> a, String... path); @SuppressWarnings("unchecked") static void merge(Map<String, Object> a, Map<String, Object> b, String... path); @SuppressWarnings("unchecked") static Map<String, Object> deepMerge(Map<String, Object> a, Map<String, Object> b); @SafeVarargs static Map<String, Object> deepMerge(Map<String, Object>... maps); static Map<String, Object> toNested(String k, Object v); @SuppressWarnings("rawtypes") static boolean deepEquals(Object a, Object b); @SafeVarargs static Set<T> distinct(Collection<T>... collections);  }### Answer:
@Test public void deepMergeTest() { Map<String, Object> m1 = new HashMap<>(); m1.put("a", "a-value1"); m1.put("b", "b-value1"); Map<String, Object> m2 = new HashMap<>(); m1.put("a", "a-value2"); m1.put("c", "b-value2"); Map<String, Object> result = ConfigurationUtils.deepMerge(m1, m2); assertEquals("a-value2", result.get("a")); assertEquals("b-value1", result.get("b")); assertEquals("b-value2", result.get("c")); }