public static Builder forCurrentMagic(ProduceRequestData data) {
        return forMagic(RecordBatch.CURRENT_MAGIC_VALUE, data);
    }
@Test
    public void shouldBeFlaggedAsTransactionalWhenTransactionalRecords() {
        final MemoryRecords memoryRecords = MemoryRecords.withTransactionalRecords(0, Compression.NONE, 1L,
                (short) 1, 1, 1, simpleRecord);

        final ProduceRequest request = ProduceRequest.forCurrentMagic(new ProduceRequestData()
                .setTopicData(new ProduceRequestData.TopicProduceDataCollection(Collections.singletonList(
                    new ProduceRequestData.TopicProduceData()
                        .setName("topic")
                        .setPartitionData(Collections.singletonList(
                            new ProduceRequestData.PartitionProduceData()
                                .setIndex(1)
                                .setRecords(memoryRecords)))).iterator()))
                .setAcks((short) -1)
                .setTimeoutMs(10)).build();
        assertTrue(RequestUtils.hasTransactionalRecords(request));
    }