private ShareGroupHeartbeatResponse createShareGroupHeartbeatResponse() {
        ShareGroupHeartbeatResponseData data = new ShareGroupHeartbeatResponseData()
                .setErrorCode(Errors.NONE.code())
                .setThrottleTimeMs(1000)
                .setMemberId("memberid")
                .setMemberEpoch(11)
                .setAssignment(new ShareGroupHeartbeatResponseData.Assignment()
                        .setTopicPartitions(Arrays.asList(
                                new ShareGroupHeartbeatResponseData.TopicPartitions()
                                        .setTopicId(Uuid.randomUuid())
                                        .setPartitions(Arrays.asList(0, 1, 2)),
                                new ShareGroupHeartbeatResponseData.TopicPartitions()
                                        .setTopicId(Uuid.randomUuid())
                                        .setPartitions(Arrays.asList(3, 4, 5))
                        ))
                );
        return new ShareGroupHeartbeatResponse(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