code: private CompletableFuture<CopycatServer> start(Supplier<CompletableFuture<Void>> joiner) {
      if (started)
        return CompletableFuture.completedFuture(this);
  
      if (openFuture == null) {
        synchronized (this) {
          if (openFuture == null) {
            Function<Void, CompletionStage<CopycatServer>> completionFunction = state -> {
              CompletableFuture<CopycatServer> future = new CompletableFuture<>();
              openFuture = null;
              joiner.get().whenComplete((result, error) -> {
                if (error == null) {
                  if (cluster().leader() != null) {
                    started = true;
                    future.complete(this);
                  } else {
                    electionListener = cluster().onLeaderElection(leader -> {
                      if (electionListener != null) {
                        started = true;
                        future.complete(this);
                        electionListener.close();
                        electionListener = null;
                      }
                    });
                  }
                } else {
                  future.completeExceptionally(error);
                }
              });
              return future;
            };
  
            if (closeFuture == null) {
              openFuture = listen().thenCompose(completionFunction);
            } else {
              openFuture = closeFuture.thenCompose(c -> listen().thenCompose(completionFunction));
            }
          }
        }
      }
  
      return openFuture.whenComplete((result, error) -> {
        if (error == null) {
          LOGGER.info("Server started successfully!");
        } else {
          LOGGER.warn("Failed to start server!");
        }
      });
    }
docs: Starts the server.