public AddPartitionsToTxnRequest normalizeRequest() {
        return new AddPartitionsToTxnRequest(new AddPartitionsToTxnRequestData().setTransactions(singletonTransaction()), version());
    }
@Test
    public void testNormalizeRequest() {
        List<TopicPartition> partitions = new ArrayList<>();
        partitions.add(TP_0);
        partitions.add(TP_1);

        AddPartitionsToTxnRequest.Builder builder = AddPartitionsToTxnRequest.Builder.forClient(transactionalId1, PRODUCER_ID, PRODUCER_EPOCH, partitions);
        AddPartitionsToTxnRequest request = builder.build((short) 3);

        AddPartitionsToTxnRequest singleton = request.normalizeRequest();
        assertEquals(partitions, singleton.partitionsByTransaction().get(transactionalId1));
        
        AddPartitionsToTxnTransaction transaction = singleton.data().transactions().find(transactionalId1);
        assertEquals(PRODUCER_ID, transaction.producerId());
        assertEquals(PRODUCER_EPOCH, transaction.producerEpoch());
    }