private void throwIfShareGroupMemberEpochIsInvalid(
        ShareGroupMember member,
        int receivedMemberEpoch
    ) {
        if (receivedMemberEpoch > member.memberEpoch()) {
            throw new FencedMemberEpochException("The share group member has a greater member "
                + "epoch (" + receivedMemberEpoch + ") than the one known by the group coordinator ("
                + member.memberEpoch() + "). The member must abandon all its partitions and rejoin.");
        }
    }
Validates the member epoch provided in the heartbeat request.

@param member                The share group member.
@param receivedMemberEpoch   The member epoch.

@throws FencedMemberEpochException if the provided epoch is ahead or behind the epoch known
                                   by this coordinator.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java