public String vote(Set<String> candidates) {
        for (JoinGroupRequestProtocol protocol : supportedProtocols) {
            if (candidates.contains(protocol.name())) {
                return protocol.name();
            }
        }

        throw new IllegalArgumentException("Member does not support any of the candidate protocols");
    }
@Test
    public void testVoteRaisesOnNoSupportedProtocols() {
        JoinGroupRequestProtocolCollection protocols = new JoinGroupRequestProtocolCollection();
        protocols.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[]{0}));
        protocols.add(new JoinGroupRequestProtocol()
            .setName("roundrobin")
            .setMetadata(new byte[]{1}));

        ClassicGroupMember member = new ClassicGroupMember(
            "member",
            Optional.of("group-instance-id"),
            "client-id",
            "client-host",
            10,
            4500,
            "generic",
            protocols,
            EMPTY_ASSIGNMENT
        );

        assertThrows(IllegalArgumentException.class, () ->
            member.vote(Collections.singleton("unknown"))
        );
    }