private ListTransactionsResponse createListTransactionsResponse() {
        ListTransactionsResponseData response = new ListTransactionsResponseData();
        response.setErrorCode(Errors.NONE.code());
        response.setTransactionStates(asList(
            new ListTransactionsResponseData.TransactionState()
                .setTransactionalId("foo")
                .setProducerId(12345L)
                .setTransactionState("Ongoing"),
            new ListTransactionsResponseData.TransactionState()
                .setTransactionalId("bar")
                .setProducerId(98765L)
                .setTransactionState("PrepareAbort")
        ));
        return new ListTransactionsResponse(response);
    }
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