docs: private void handleMembershipChange(ClusterMembershipEvent event) {
      if (event.type() == ClusterMembershipEvent.Type.MEMBER_ADDED) {
        bootstrap(event.subject());
      } else if (event.type() == ClusterMembershipEvent.Type.MEMBER_REMOVED) {
        threadContext.execute(() -> {
          PartitionGroupMembership systemGroup = this.systemGroup;
          if (systemGroup != null && systemGroup.members().contains(event.subject().id())) {
            Set<MemberId> newMembers = Sets.newHashSet(systemGroup.members());
            newMembers.remove(event.subject().id());
            PartitionGroupMembership newMembership = new PartitionGroupMembership(systemGroup.group(), systemGroup.config(), ImmutableSet.copyOf(newMembers), true);
            this.systemGroup = newMembership;
            post(new PartitionGroupMembershipEvent(MEMBERS_CHANGED, newMembership));
          }
  
          groups.values().forEach(group -> {
            if (group.members().contains(event.subject().id())) {
              Set<MemberId> newMembers = Sets.newHashSet(group.members());
              newMembers.remove(event.subject().id());
              PartitionGroupMembership newMembership = new PartitionGroupMembership(group.group(), group.config(), ImmutableSet.copyOf(newMembers), false);
              groups.put(group.group(), newMembership);
              post(new PartitionGroupMembershipEvent(MEMBERS_CHANGED, newMembership));
            }
          });
        });
      }
    }