question: private static void merge ( ObjectNode tree , ObjectNode overrideTree ) { Iterator < String > fieldNames = overrideTree . fieldNames ( ) ; while ( fieldNames . hasNext ( ) ) { String fieldName = fieldNames . next ( ) ; JsonNode primaryValue = tree . get ( fieldName ) ; JsonNode backupValue = overrideTree . get ( fieldName ) ; if ( primaryValue == null ) { if ( backupValue != null ) { tree . set ( fieldName , backupValue ) ; } } else if ( backupValue . isNull ( ) ) { tree . remove ( fieldName ) ; } else if ( primaryValue . isObject ( ) && backupValue . isObject ( ) ) { merge ( ( ObjectNode ) primaryValue , ( ObjectNode ) backupValue . deepCopy ( ) ) ; } else { tree . set ( fieldName , overrideTree . get ( fieldName ) ) ; } } }
target:  Overwrites the fields of tree that intersect with those of overrideTree. <p>Values of tree are modified, and values of overrideTree are not modified. The merge process loops through the fields of tree and replaces non-object values with the corresponding value from overrideTree if present. Object values are traversed recursively to replace sub-properties. Null fields in overrideTree are removed from tree.