static Optional<String> ensurePropertyAndGetWarning(
            Map<String, ? super String> props,
            String key,
            String expectedValue,
            String justification,
            boolean caseSensitive) {
        if (!props.containsKey(key)) {
            // Insert the expected value
            props.put(key, expectedValue);
            // But don't issue a warning to the user
            return Optional.empty();
        }

        String value = Objects.toString(props.get(key));
        boolean matchesExpectedValue = caseSensitive ? expectedValue.equals(value) : expectedValue.equalsIgnoreCase(value);
        if (matchesExpectedValue) {
            return Optional.empty();
        }

        // Insert the expected value
        props.put(key, expectedValue);

        justification = justification != null ? " " + justification : "";
        // And issue a warning to the user
        return Optional.of(String.format(
                "The value '%s' for the '%s' property will be ignored as it cannot be overridden%s. "
                        + "The value '%s' will be used instead.",
                value, key, justification, expectedValue
        ));
    }
Ensure that a given key has an expected value in the properties, inserting the expected value into the
properties if necessary. If a user-supplied value is overridden, return a warning message that can
be logged to the user notifying them of this fact.

@return an {@link Optional} containing a warning that should be logged to the user if a value they
supplied in the properties is being overridden, or {@link Optional#empty()} if no such override has
taken place
connect/runtime/src/main/java/org/apache/kafka/connect/util/ConnectUtils.java