private ConsumerGroupHeartbeatRequest createConsumerGroupHeartbeatRequest(short version) {
        ConsumerGroupHeartbeatRequestData data = new ConsumerGroupHeartbeatRequestData()
            .setGroupId("group")
            .setMemberId("memberid")
            .setMemberEpoch(10)
            .setRebalanceTimeoutMs(60000)
            .setServerAssignor("range")
            .setRackId("rackid")
            .setSubscribedTopicNames(Arrays.asList("foo", "bar"))
            .setTopicPartitions(Arrays.asList(
                new ConsumerGroupHeartbeatRequestData.TopicPartitions()
                    .setTopicId(Uuid.randomUuid())
                    .setPartitions(Arrays.asList(0, 1, 2)),
                new ConsumerGroupHeartbeatRequestData.TopicPartitions()
                    .setTopicId(Uuid.randomUuid())
                    .setPartitions(Arrays.asList(3, 4, 5))
            ));
        return new ConsumerGroupHeartbeatRequest.Builder(data).build(version);
    }
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