public static DynamicVoters parse(String input) {
        input = input.trim();
        List<DynamicVoter> voters = new ArrayList<>();
        for (String voterString : input.split(",")) {
            if (!voterString.isEmpty()) {
                voters.add(DynamicVoter.parse(voterString));
            }
        }
        return new DynamicVoters(voters);
    }
@Test
    public void testParsingInvalidStringWithDuplicateNodeIds() {
        assertEquals("Node id 1 was specified more than once.",
            assertThrows(IllegalArgumentException.class,
                () -> DynamicVoters.parse(
                    "0@localhost:8020:K90IZ-0DRNazJ49kCZ1EMQ," +
                    "1@localhost:8030:aUARLskQTCW4qCZDtS_cwA," +
                    "1@localhost:8040:2ggvsS4kQb-fSJ_-zC_Ang")).
                        getMessage());
    }