private static ConsumerProtocolSubscription deserializeSubscription(
        JoinGroupRequestProtocolCollection protocols
    ) {
        try {
            return ConsumerProtocol.deserializeConsumerProtocolSubscription(
                ByteBuffer.wrap(protocols.iterator().next().metadata())
            );
        } catch (SchemaException e) {
            throw new IllegalStateException("Malformed embedded consumer protocol in subscription deserialization.");
        }
    }
Deserialize the subscription in JoinGroupRequestProtocolCollection.
All the protocols have the same subscription, so the method picks a random one.

@param protocols The JoinGroupRequestProtocolCollection.
@return The ConsumerProtocolSubscription.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java