public List<PartitionInfo> partitionsFor(String topic) {
        if (this.partitionsForException != null) {
            throw this.partitionsForException;
        }

        return this.cluster.partitionsForTopic(topic);
    }
Get the next offset for this topic/partition
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java