docs: protected MemberId next() {
      // If a connection was already established then use that connection.
      if (currentNode != null) {
        return currentNode;
      }
  
      if (!selector.hasNext()) {
        if (selector.leader() != null) {
          selector.reset(null, selector.members());
          this.currentNode = selector.next();
          this.selectionId++;
          return currentNode;
        } else {
          log.debug("Failed to connect to the cluster");
          selector.reset();
          return null;
        }
      } else {
        this.currentNode = selector.next();
        this.selectionId++;
        return currentNode;
      }
    }