public boolean isVoter(ReplicaKey replicaKey) {
        return Optional.ofNullable(voters.get(replicaKey.id()))
            .map(node -> node.isVoter(replicaKey))
            .orElse(false);
    }
Returns if the node is a voter in the set of voters.

If the voter set includes the directory id, the {@code replicaKey} directory id must match the
directory id specified by the voter set.

If the voter set doesn't include the directory id ({@code Optional.empty()}), a node is in
the voter set as long as the node id matches. The directory id is not checked.

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