protected synchronized boolean rebalanceInProgress() {
        return this.state == MemberState.PREPARING_REBALANCE || this.state == MemberState.COMPLETING_REBALANCE;
    }
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