public boolean matches(JoinGroupRequestProtocolCollection protocols) {
        return protocols.equals(this.supportedProtocols);
    }
@Test
    public void testMatchesSupportedProtocols() {
        JoinGroupRequestProtocolCollection protocols = new JoinGroupRequestProtocolCollection();
        protocols.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[]{0}));

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

        JoinGroupRequestProtocolCollection collection = new JoinGroupRequestProtocolCollection();
        collection.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[] {0}));

        assertTrue(member.matches(collection));

        collection = new JoinGroupRequestProtocolCollection();
        collection.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[] {1}));

        assertFalse(member.matches(collection));

        collection = new JoinGroupRequestProtocolCollection();
        collection.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[0]));

        assertFalse(member.matches(collection));

        collection = new JoinGroupRequestProtocolCollection();
        collection.add(new JoinGroupRequestProtocol()
            .setName("range")
            .setMetadata(new byte[0]));

        collection.add(new JoinGroupRequestProtocol()
            .setName("roundrobin")
            .setMetadata(new byte[0]));

        assertFalse(member.matches(collection));
        assertTrue(member.matches(protocols));
    }