private void subscribeGroupToTopic(
        String groupId,
        String topicName
    ) {
        groupsByTopics
            .computeIfAbsent(topicName, __ -> new TimelineHashSet<>(snapshotRegistry, 1))
            .add(groupId);
    }
Subscribes a group to a topic.

@param groupId   The group id.
@param topicName The topic name.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java