public boolean canDetect(Object value) {
            if (value == null) {
                optional = true;
                return true;
            }
            Schema schema = inferSchema(value);
            if (schema == null) {
                return false;
            }
            if (knownType == null) {
                knownType = schema.type();
            } else if (knownType != schema.type()) {
                return false;
            }
            return true;
        }
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