public boolean isSubscribedToTopic(String topic) {
        return subscribedTopics.map(topics -> topics.contains(topic))
            .orElse(usesConsumerGroupProtocol());
    }
Returns true if the classic group is actively subscribed to the topic. When the classic group does not know,
because the information is not available yet or because it has failed to parse the Consumer Protocol, we
consider the group not subscribed to the topic if the group is not using any protocol or not using the
consumer group protocol.

@param topic  The topic name.

@return whether the group is subscribed to the topic.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java