private DescribeTopicPartitionsResponse createDescribeTopicPartitionsResponse() {
        DescribeTopicPartitionsResponseData.DescribeTopicPartitionsResponseTopicCollection collection =
                new DescribeTopicPartitionsResponseData.DescribeTopicPartitionsResponseTopicCollection();
        collection.add(
                new DescribeTopicPartitionsResponseData.DescribeTopicPartitionsResponseTopic()
                        .setTopicId(Uuid.fromString("sKhZV8LnTA275KvByB9bVg"))
                        .setErrorCode((short) 0)
                        .setIsInternal(false)
                        .setName("foo")
                        .setTopicAuthorizedOperations(0)
                        .setPartitions(singletonList(
                                new DescribeTopicPartitionsResponseData.DescribeTopicPartitionsResponsePartition()
                                        .setErrorCode((short) 0)
                                        .setIsrNodes(singletonList(1))
                                        .setPartitionIndex(1)
                                        .setLeaderId(1)
                                        .setReplicaNodes(singletonList(1))
                                        .setLeaderEpoch(0)
                        ))
        );
        DescribeTopicPartitionsResponseData data = new DescribeTopicPartitionsResponseData()
                .setTopics(collection)
                .setNextCursor(
                        new DescribeTopicPartitionsResponseData.Cursor().setTopicName("foo").setPartitionIndex(2)
                );
        return new DescribeTopicPartitionsResponse(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