private static void checkMaybeCompatible(Schema source, Schema target) {
        if (source.type() != target.type() && !isPromotable(source.type(), target.type())) {
            throw new SchemaProjectorException("Schema type mismatch. source type: " + source.type() + " and target type: " + target.type());
        } else if (!Objects.equals(source.name(), target.name())) {
            throw new SchemaProjectorException("Schema name mismatch. source name: " + source.name() + " and target name: " + target.name());
        } else if (!Objects.equals(source.parameters(), target.parameters())) {
            throw new SchemaProjectorException("Schema parameters not equal. source parameters: " + source.parameters() + " and target parameters: " + target.parameters());
        }
    }
This method projects a value between compatible schemas and throws exceptions when non-compatible schemas are provided
@param source the schema used to construct the record
@param record the value to project from source schema to target schema
@param target the schema to project the record to
@return the projected value with target schema
@throws SchemaProjectorException if the target schema is not optional and does not have a default value
connect/api/src/main/java/org/apache/kafka/connect/data/SchemaProjector.java