private ShareCompletedFetch completedFetch(TopicIdPartition tp) {
        ShareFetchMetricsAggregator shareFetchMetricsAggregator = new ShareFetchMetricsAggregator(shareFetchMetricsManager,
                allPartitions.stream().map(TopicIdPartition::topicPartition).collect(Collectors.toSet()));
        ShareFetchResponseData.PartitionData partitionData = new ShareFetchResponseData.PartitionData();
        return new ShareCompletedFetch(
                logContext,
                BufferSupplier.create(),
                tp,
                partitionData,
                shareFetchMetricsAggregator,
                ApiKeys.SHARE_FETCH.latestVersion());
    }
Tests that the buffer returns partitions for both the queue and the next-in-line buffer.
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ShareFetchBufferTest.java