public static void replayAllBatches(Object target,
                                        List<List<ApiMessageAndVersion>> batches) {
        for (List<ApiMessageAndVersion> batch : batches) {
            replayAll(target, batch);
        }
    }
Replay a list of record batches.

@param target        The object to invoke the replay function on.
@param batches       A list of batches of records.
metadata/src/test/java/org/apache/kafka/metadata/RecordTestUtils.java