code: public final Membership join(Supplier<byte[]> memberData, @Nullable Runnable onLoseMembership)
        throws JoinException, InterruptedException {
  
      Objects.requireNonNull(memberData);
      ensurePersistentGroupPath();
  
      final ActiveMembership groupJoiner = new ActiveMembership(memberData, onLoseMembership);
      return backoffHelper.doUntilResult(new ExceptionalSupplier<Membership, JoinException>() {
        @Override public Membership get() throws JoinException {
          try {
            return groupJoiner.join();
          } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new JoinException("Interrupted trying to join group at path: " + path, e);
          } catch (ZooKeeperConnectionException e) {
            LOG.log(Level.WARNING, "Temporary error trying to join group at path: " + path, e);
            return null;
          } catch (KeeperException e) {
            if (zkClient.shouldRetry(e)) {
              LOG.log(Level.WARNING, "Temporary error trying to join group at path: " + path, e);
              return null;
            } else {
              throw new JoinException("Problem joining partition group at path: " + path, e);
            }
          }
        }
      });
    }
docs: Joins this group and returns the resulting Membership when successful.  Membership will be
  automatically cancelled when the current jvm process dies; however the returned Membership
  object can be used to cancel membership earlier.  Unless
  {@link com.twitter.common.zookeeper.Group.Membership#cancel()} is called the membership will
  be maintained by re-establishing it silently in the background.
  
  <p>Any {@code memberData} given is persisted in the member node in ZooKeeper.  If an
  {@code onLoseMembership} callback is supplied, it will be notified each time this member loses
  membership in the group.
  
  @param memberData a supplier of the data to store in the member node
  @param onLoseMembership a callback to notify when membership is lost
  @return a Membership object with the member details
  @throws JoinException if there was a problem joining the group
  @throws InterruptedException if this thread is interrupted awaiting completion of the join