@Test
    public void testSetCreateTimeNotAllowedV0() {
        MemoryRecords records = MemoryRecords.withRecords(RecordBatch.MAGIC_VALUE_V0, 0L,
                Compression.gzip().build(), TimestampType.CREATE_TIME,
                new SimpleRecord(1L, "a".getBytes(), "1".getBytes()),
                new SimpleRecord(2L, "b".getBytes(), "2".getBytes()),
                new SimpleRecord(3L, "c".getBytes(), "3".getBytes()));
        long createTime = 15L;
        ByteBufferLegacyRecordBatch batch = new ByteBufferLegacyRecordBatch(records.buffer());
        assertThrows(UnsupportedOperationException.class, () -> batch.setMaxTimestamp(TimestampType.CREATE_TIME, createTime));
    }
The wrapper offset should be 0 in v0, but not in v1. However, the latter worked by accident and some versions of
librdkafka now depend on it. So we support 0 for compatibility reasons, but the recommendation is to set the
wrapper offset to the relative offset of the last record in the batch.
clients/src/test/java/org/apache/kafka/common/record/AbstractLegacyRecordBatchTest.java