private void checkSchemaType(Schema schema, Type type) {
        if (schema.type() != type) {
            throw new DataException("Expecting " + type + " but instead found " + schema.type());
        }
    }
Check the {@link Schema#type() schema's type} matches the specified type.

@param schema the schema; never null
@param type   the expected type
@throws DataException if the schema's type does not match the expected type
connect/api/src/main/java/org/apache/kafka/connect/header/ConnectHeaders.java