code: public CompletableFuture<Void> leave() {
      if (!started)
        return CompletableFuture.completedFuture(null);
  
      if (closeFuture == null) {
        synchronized (this) {
          if (closeFuture == null) {
            closeFuture = new CompletableFuture<>();
            if (openFuture == null) {
              cluster().leave().whenComplete((leaveResult, leaveError) -> {
                shutdown().whenComplete((shutdownResult, shutdownError) -> {
                  context.delete();
                  closeFuture.complete(null);
                });
              });
            } else {
              openFuture.whenComplete((openResult, openError) -> {
                if (openError == null) {
                  cluster().leave().whenComplete((leaveResult, leaveError) -> {
                    shutdown().whenComplete((shutdownResult, shutdownError) -> {
                      context.delete();
                      closeFuture.complete(null);
                    });
                  });
                } else {
                  closeFuture.complete(null);
                }
              });
            }
          }
        }
      }
  
      return closeFuture;
    }
docs: Leaves the Copycat cluster.
  <p>
  When the server is stopped, the underlying {@link Transport} will be {@link Transport#close() closed}.
  
  @return A completable future to be completed once the server has left the cluster.