@Override
    public int numPartitions(Uuid topicId) {
        TopicMetadata topic = this.topicMetadata.get(topicId);
        return topic == null ? -1 : topic.numPartitions();
    }
The number of partitions for the given topic Id.

@param topicId   Uuid corresponding to the topic.
@return The number of partitions corresponding to the given topic Id,
        or -1 if the topic Id does not exist.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/SubscribedTopicDescriberImpl.java