private Map<TopicPartition, PartitionData> buildResponseData(String groupId) {
        Map<TopicPartition, PartitionData> responseData = new HashMap<>();
        OffsetFetchResponseGroup group = data
            .groups()
            .stream()
            .filter(g -> g.groupId().equals(groupId))
            .collect(Collectors.toList())
            .get(0);
        for (OffsetFetchResponseTopics topic : group.topics()) {
            for (OffsetFetchResponsePartitions partition : topic.partitions()) {
                responseData.put(new TopicPartition(topic.name(), partition.partitionIndex()),
                    new PartitionData(partition.committedOffset(),
                        RequestUtils.getLeaderEpoch(partition.committedLeaderEpoch()),
                        partition.metadata(),
                        Errors.forCode(partition.errorCode()))
                );
            }
        }
        return responseData;
    }
Constructor with throttle time for version 8 and above.
@param throttleTimeMs The time in milliseconds that this response was throttled
@param errors Potential coordinator or group level error code
@param responseData Fetched offset information grouped by topic-partition and by group
clients/src/main/java/org/apache/kafka/common/requests/OffsetFetchResponse.java