public String validateString(String name, boolean isRequired) throws ValidateException {
        String value = (String) options.get(name);

        if (value == null) {
            if (isRequired)
                throw new ConfigException(String.format("The OAuth configuration option %s value must be non-null", name));
            else
                return null;
        }

        value = value.trim();

        if (value.isEmpty()) {
            if (isRequired)
                throw new ConfigException(String.format("The OAuth configuration option %s value must not contain only whitespace", name));
            else
                return null;
        }

        return value;
    }
<code>JaasOptionsUtils</code> is a utility class to perform logic for the JAAS options and
is separated out here for easier, more direct testing.
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/JaasOptionsUtils.java