public long remainingElectionTimeMs(long currentTimeMs) {
        electionTimer.update(currentTimeMs);
        return electionTimer.remainingMs();
    }
The "voted" state is for voters who have cast their vote for a specific candidate.

Once a vote has been cast, it is not possible for a voter to change its vote until a
new election is started. If the election timeout expires before a new leader is elected,
then the voter will become a candidate.
raft/src/main/java/org/apache/kafka/raft/VotedState.java