private void throwIfGenerationIdUnmatched(
        String memberId,
        int memberEpoch,
        int requestGenerationId
    ) {
        if (memberEpoch != requestGenerationId) {
            throw Errors.ILLEGAL_GENERATION.exception(
                String.format("The request generation id %s is not equal to the member epoch %d of member %s.",
                    requestGenerationId, memberEpoch, memberId)
            );
        }
    }
Validates if the generation id from the request matches the member epoch.

@param memberId              The member id.
@param memberEpoch           The member epoch.
@param requestGenerationId   The generation id from the request.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java