public Map<TaskId, Set<TopicPartition>> partitionGroups(final Map<Subtopology, Set<String>> topicGroups, final Cluster metadata) {
        return partitionGroups(topicGroups, new HashMap<>(), new HashMap<>(), metadata);
    }
Generate tasks with the assigned topic partitions.

@param topicGroups   group of topics that need to be joined together
@param metadata      metadata of the consuming cluster
@return The map from generated task ids to the assigned partitions
streams/src/main/java/org/apache/kafka/streams/processor/internals/PartitionGrouper.java