protected void assertTopic(MockAdminClient admin, String topicName, int expectedPartitions, int expectedReplicas) {
        TopicDescription desc = null;
        try {
            desc = topicDescription(admin, topicName);
        } catch (Throwable t) {
            fail("Failed to find topic description for topic '" + topicName + "'");
        }
        assertEquals(expectedPartitions, desc.partitions().size());
        for (TopicPartitionInfo tp : desc.partitions()) {
            assertEquals(expectedReplicas, tp.replicas().size());
        }
    }
Create a ListOffsetResponse that exposes the supplied error and includes offsets for the supplied partitions.
@param error               the error; may be null if an unknown error should be used
@param offsetsByPartitions offset for each partition, where offset is null signals the error should be used
@return the response
connect/runtime/src/test/java/org/apache/kafka/connect/util/TopicAdminTest.java