static void verifyTopics(
        Logger log, Admin adminClient,
        Collection<String> topicsToVerify, Map<String, NewTopic> topicsInfo, int retryCount, long retryBackoffMs) throws Throwable {

        Map<String, TopicDescription> topicDescriptionMap = topicDescriptions(topicsToVerify, adminClient,
                retryCount, retryBackoffMs);

        for (TopicDescription desc: topicDescriptionMap.values()) {
            // map will always contain the topic since all topics in 'topicsExists' are in given
            // 'topics' map
            int partitions = topicsInfo.get(desc.name()).numPartitions();
            if (partitions != CreateTopicsRequest.NO_NUM_PARTITIONS && desc.partitions().size() != partitions) {
                String str = "Topic '" + desc.name() + "' exists, but has "
                             + desc.partitions().size() + " partitions, while requested "
                             + " number of partitions is " + partitions;
                log.warn(str);
                throw new RuntimeException(str);
            }
        }
    }
Verifies that topics in 'topicsToVerify' list have the same number of partitions as
described in 'topicsInfo'
@param log                The logger to use
@param adminClient        AdminClient
@param topicsToVerify     List of topics to verify
@param topicsInfo         Map of topic name to topic description, which includes topics in
                          'topicsToVerify' list.
@param retryCount         The number of times to retry the fetching of the topics
@param retryBackoffMs     The amount of time, in milliseconds, to wait in between retries
@throws UnknownTopicOrPartitionException If at least one topic contained in 'topicsInfo'
does not exist after retrying.
@throws RuntimeException  If one or more topics have different number of partitions than
described in 'topicsInfo'
trogdor/src/main/java/org/apache/kafka/trogdor/common/WorkerUtils.java