private static Set<TopicIdPartition> topicIdPartitions(
        Collection<Uuid> topicIds,
        SubscribedTopicDescriber subscribedTopicDescriber
    ) {
        Set<TopicIdPartition> topicIdPartitions = new HashSet<>();
        for (Uuid topicId : topicIds) {
            int numPartitions = subscribedTopicDescriber.numPartitions(topicId);
            for (int partitionId = 0; partitionId < numPartitions; partitionId++) {
                topicIdPartitions.add(new TopicIdPartition(topicId, partitionId));
            }
        }
        return topicIdPartitions;
    }
Constructs a set of {@code TopicIdPartition} including all the given topic Ids based on their partition counts.

@param topicIds                      Collection of topic Ids.
@param subscribedTopicDescriber      Describer to fetch partition counts for topics.

@return Set of {@code TopicIdPartition} including all the provided topic Ids.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/UniformHeterogeneousAssignmentBuilder.java