@Override
    protected void maybeUpdateGroupState() {
        ShareGroupState newState = ShareGroupState.STABLE;
        if (members.isEmpty()) {
            newState = ShareGroupState.EMPTY;
        }

        state.set(newState);
    }
Updates the current state of the group.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/share/ShareGroup.java