@Override
    public ConsumerGroupDescribeResponse getErrorResponse(int throttleTimeMs, Throwable e) {
        ConsumerGroupDescribeResponseData data = new ConsumerGroupDescribeResponseData()
            .setThrottleTimeMs(throttleTimeMs);
        // Set error for each group
        this.data.groupIds().forEach(
            groupId -> data.groups().add(
                new ConsumerGroupDescribeResponseData.DescribedGroup()
                    .setGroupId(groupId)
                    .setErrorCode(Errors.forException(e).code())
            )
        );
        return new ConsumerGroupDescribeResponse(data);
    }
@Test
    void testGetErrorResponse() {
        List<String> groupIds = Arrays.asList("group0", "group1");
        ConsumerGroupDescribeRequestData data = new ConsumerGroupDescribeRequestData();
        data.groupIds().addAll(groupIds);
        ConsumerGroupDescribeRequest request = new ConsumerGroupDescribeRequest.Builder(data, true)
            .build();
        Throwable e = Errors.GROUP_AUTHORIZATION_FAILED.exception();
        int throttleTimeMs = 1000;

        ConsumerGroupDescribeResponse response = request.getErrorResponse(throttleTimeMs, e);

        assertEquals(throttleTimeMs, response.throttleTimeMs());
        for (int i = 0; i < groupIds.size(); i++) {
            ConsumerGroupDescribeResponseData.DescribedGroup group = response.data().groups().get(i);
            assertEquals(groupIds.get(i), group.groupId());
            assertEquals(Errors.forException(e).code(), group.errorCode());
        }
    }