public static ApiMessageAndVersion testRecord(int index) {
        MockRandom random = new MockRandom(index);
        return new ApiMessageAndVersion(
            new TopicRecord().setName("test" + index).
            setTopicId(new Uuid(random.nextLong(), random.nextLong())), (short) 0);
    }
Create a batch reader for testing.

@param lastOffset the last offset of the given list of records
@param appendTimestamp the append timestamp for the batches created
@param records the records
@return a batch reader which will return the given records
metadata/src/test/java/org/apache/kafka/metadata/RecordTestUtils.java