void (@NotNull JsonSchemaObject thisObject, @NotNull JsonSchemaObject otherObject) { for (Map.Entry<String, JsonSchemaObject> prop: otherObject.myProperties.entrySet()) { String key = prop.getKey(); JsonSchemaObject otherProp = prop.getValue(); if (!thisObject.myProperties.containsKey(key)) { thisObject.myProperties.put(key, otherProp); } else { JsonSchemaObject existingProp = thisObject.myProperties.get(key); thisObject.myProperties.put(key, merge(existingProp, otherProp, otherProp)); } } }