private void throwIfEmptyString(
        String value,
        String error
    ) throws InvalidRequestException {
        if (value != null && value.trim().isEmpty()) {
            throw new InvalidRequestException(error);
        }
    }
Throws an InvalidRequestException if the value is non-null and empty.
A string containing only whitespaces is also considered empty.

@param value The value.
@param error The error message.
@throws InvalidRequestException
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java