public static VoterSet fromInetSocketAddresses(ListenerName listener, Map<Integer, InetSocketAddress> voters) {
        Map<Integer, VoterNode> voterNodes = voters
            .entrySet()
            .stream()
            .collect(
                Collectors.toMap(
                    Map.Entry::getKey,
                    entry -> new VoterNode(
                        ReplicaKey.of(entry.getKey(), Uuid.ZERO_UUID),
                        Endpoints.fromInetSocketAddresses(Collections.singletonMap(listener, entry.getValue())),
                        new SupportedVersionRange((short) 0, (short) 0)
                    )
                )
            );

        return new VoterSet(voterNodes);
    }
Creates a voter set from a map of socket addresses.

@param listener the listener name for all of the endpoints
@param voters the socket addresses by voter id
@return the voter set
raft/src/main/java/org/apache/kafka/raft/internals/VoterSet.java