private void throwIfNotNull(
        Object value,
        String error
    ) throws InvalidRequestException {
        if (value != null) {
            throw new InvalidRequestException(error);
        }
    }
Throws an InvalidRequestException if the value is non-null.

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