public byte[] metadata(String protocolName) {
        for (JoinGroupRequestProtocol protocol : supportedProtocols) {
            if (protocol.name().equals(protocolName)) {
                return protocol.metadata();
            }
        }

        throw new IllegalArgumentException("Member does not support protocol " +
            protocolName);
    }
@Test
    public void testMetadata() {
        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
        );

        assertArrayEquals(new byte[]{0}, member.metadata("range"));
        assertArrayEquals(new byte[]{1}, member.metadata("roundrobin"));
    }