public static Builder forCurrentMagic(ProduceRequestData data) {
        return forMagic(RecordBatch.CURRENT_MAGIC_VALUE, data);
    }
@Test
    public void testV3AndAboveCannotHaveNoRecordBatches() {
        ProduceRequest.Builder requestBuilder = ProduceRequest.forCurrentMagic(new ProduceRequestData()
                .setTopicData(new ProduceRequestData.TopicProduceDataCollection(Collections.singletonList(
                        new ProduceRequestData.TopicProduceData()
                                .setName("test")
                                .setPartitionData(Collections.singletonList(
                                        new ProduceRequestData.PartitionProduceData()
                                                .setIndex(0)
                                                .setRecords(MemoryRecords.EMPTY)))).iterator()))
                .setAcks((short) 1)
                .setTimeoutMs(5000));
        assertThrowsForAllVersions(requestBuilder, InvalidRecordException.class);
    }