protected void produceMessages(Producer<byte[], byte[]> producer, List<ProducerRecord<byte[], byte[]>> records) {
        Timer timer = Time.SYSTEM.timer(RECORD_PRODUCE_DURATION_MS);

        try {
            for (ProducerRecord<byte[], byte[]> record : records) {
                producer.send(record).get(timer.remainingMs(), TimeUnit.MILLISECONDS);
                timer.update();
            }
        } catch (ExecutionException | InterruptedException | TimeoutException e) {
            throw new RuntimeException(e);
        }
    }
Produce a batch of records with the specified producer
@param producer Producer to use to send records
@param records Records to send in one parallel batch
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java