private static String validateString(String name, String value) throws ValidateException {
        if (value == null)
            throw new ValidateException(String.format("%s value must be non-null", name));

        if (value.isEmpty())
            throw new ValidateException(String.format("%s value must be non-empty", name));

        value = value.trim();

        if (value.isEmpty())
            throw new ValidateException(String.format("%s value must not contain only whitespace", name));

        return value;
    }
Validates that the given claim name override is valid, where <i>invalid</i> means
<i>any</i> of the following:

<ul>
    <li><code>null</code></li>
    <li>Zero length</li>
    <li>Whitespace only</li>
</ul>

@param name  "Standard" name of the claim, e.g. <code>sub</code>
@param value "Override" name of the claim, e.g. <code>email</code>

@return Trimmed version of the <code>value</code> parameter

@throws ValidateException Thrown if the value is <code>null</code>, empty, or whitespace only
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/ClaimValidationUtils.java