public static List<ProducerRecord<byte[], byte[]>> generateRecords(String topicName, int numRecords) {
        List<ProducerRecord<byte[], byte[]>> records = new ArrayList<>();
        for (int i = 0; i < numRecords; i++) {
            String key = "key-" + i;
            String value = "message-" + i;
            records.add(new ProducerRecord<>(topicName, null, key.getBytes(), value.getBytes()));
        }
        return records;
    }
Assemble a collection of records arbitrarily distributed across all partitions of the specified topic
@param topicName Destination topic
@param numRecords count of records to produce to the topic in total
@return A batch of records that can be sent to a producer.
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/TestUtils.java