protected static Map<Object, Object> alignMapKeysAndValuesWithSchema(Schema mapSchema, Map<Object, Object> input) {
        Schema keySchema = mapSchema.keySchema();
        Schema valueSchema = mapSchema.valueSchema();
        Map<Object, Object> result = new LinkedHashMap<>();
        for (Map.Entry<?, ?> entry : input.entrySet()) {
            Object newKey = convertTo(keySchema, null, entry.getKey());
            Object newValue = convertTo(valueSchema, null, entry.getValue());
            result.put(newKey, newValue);
        }
        return result;
    }
Merge two schemas to a common schema which can represent values from both input schemas.
@param previous One Schema, non-null
@param newSchema Another schema, non-null
@return A schema that is a superset of both input schemas, or null if no common schema is found.
connect/api/src/main/java/org/apache/kafka/connect/data/Values.java