protected synchronized Generation generationIfStable() {
        if (this.state != MemberState.STABLE)
            return null;
        return generation;
    }
Get the current generation state if the group is stable, otherwise return null

@return the current generation or null
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java