public static VoterSet fromVotersRecord(VotersRecord voters) {
        HashMap<Integer, VoterNode> voterNodes = new HashMap<>(voters.voters().size());
        for (VotersRecord.Voter voter: voters.voters()) {
            voterNodes.put(
                voter.voterId(),
                new VoterNode(
                    ReplicaKey.of(voter.voterId(), voter.voterDirectoryId()),
                    Endpoints.fromVotersRecordEndpoints(voter.endpoints()),
                    new SupportedVersionRange(
                        voter.kRaftVersionFeature().minSupportedVersion(),
                        voter.kRaftVersionFeature().maxSupportedVersion()
                    )
                )
            );
        }

        return new VoterSet(voterNodes);
    }
Converts a {@code VotersRecord} to a {@code VoterSet}.

@param voters the set of voters control record
@return the voter set
raft/src/main/java/org/apache/kafka/raft/internals/VoterSet.java