private DescribeTransactionsResponse createDescribeTransactionsResponse() {
        DescribeTransactionsResponseData data = new DescribeTransactionsResponseData();
        data.setTransactionStates(asList(
            new DescribeTransactionsResponseData.TransactionState()
                .setErrorCode(Errors.NONE.code())
                .setTransactionalId("t1")
                .setProducerId(12345L)
                .setProducerEpoch((short) 15)
                .setTransactionStartTimeMs(13490218304L)
                .setTransactionState("Empty"),
            new DescribeTransactionsResponseData.TransactionState()
                .setErrorCode(Errors.NONE.code())
                .setTransactionalId("t2")
                .setProducerId(98765L)
                .setProducerEpoch((short) 30)
                .setTransactionStartTimeMs(13490218304L)
                .setTransactionState("Ongoing")
                .setTopics(new DescribeTransactionsResponseData.TopicDataCollection(
                    asList(
                        new DescribeTransactionsResponseData.TopicData()
                            .setTopic("foo")
                            .setPartitions(asList(1, 3, 5, 7)),
                        new DescribeTransactionsResponseData.TopicData()
                            .setTopic("bar")
                            .setPartitions(asList(1, 3))
                    ).iterator()
                )),
            new DescribeTransactionsResponseData.TransactionState()
                .setErrorCode(Errors.NOT_COORDINATOR.code())
                .setTransactionalId("t3")
        ));
        return new DescribeTransactionsResponse(data);
    }
Check that all error codes in the response get included in {@link AbstractResponse#errorCounts()}.
clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java