protected Optional<Boolean> checkValidationErrors(String connectorClass, Map<String, String> connConfig,
        int numErrors, BiFunction<Integer, Integer, Boolean> comp) {
        try {
            int numErrorsProduced = connect.validateConnectorConfig(connectorClass, connConfig).errorCount();
            return Optional.of(comp.apply(numErrorsProduced, numErrors));
        } catch (Exception e) {
            log.error("Could not check config validation error count.", e);
            return Optional.empty();
        }
    }
Confirm that the requested number of errors are produced by {@link EmbeddedConnect#validateConnectorConfig}.

@param connectorClass the class of the connector to validate
@param connConfig     the intended configuration
@param numErrors      the number of errors expected
@return true if exactly {@code numErrors} are produced by the validation; false otherwise
connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/ConnectAssertions.java