docs: public VoteRequest toCandidate() {
          role = RaftRole.CANDIDATE;
          preCandidateState = null;
          leaderState = null;
          candidateState = new CandidateState(majority());
          candidateState.grantVote(localEndpoint);
          persistVote(incrementTerm(), localEndpoint);
  
          return new VoteRequest(localEndpoint, term, log.lastLogOrSnapshotTerm(), log.lastLogOrSnapshotIndex());
      }