public boolean isOnlyVoter(ReplicaKey nodeKey) {
        return voters.size() == 1 && isVoter(nodeKey);
    }
Returns if the node is the only voter in the set of voters.

@param nodeKey the node's id and directory id
@return true if the node is the only voter in the voter set, otherwise false
raft/src/main/java/org/apache/kafka/raft/internals/VoterSet.java