code: private static group_stream_response newGroupStream(Stream<Map.Entry<DateTime, TimeSeriesValue>> tsc, int fetch) {
          final BufferedIterator<Map.Entry<DateTime, TimeSeriesValue>> iter = new BufferedIterator<>(tsc.iterator(), GROUP_STREAM_QUEUE_SIZE);
          final long idx = GROUP_STREAM_ITERS_ALLOC.getAndIncrement();
          final IteratorAndCookie<Map.Entry<DateTime, TimeSeriesValue>> iterAndCookie = new IteratorAndCookie<>(iter);
          GROUP_STREAM_ITERS.put(idx, iterAndCookie);
  
          final List<Map.Entry<DateTime, TimeSeriesValue>> result = fetchFromIter(iter, fetch, MAX_GROUP_STREAM_FETCH);
          EncDec.NewIterResponse<Map.Entry<DateTime, TimeSeriesValue>> responseObj
                  = new EncDec.NewIterResponse<>(idx, result, iter.atEnd(), iterAndCookie.getCookie());
          LOG.log(Level.FINE, "responseObj = {0}", responseObj);
          return EncDec.encodeStreamGroupResponse(responseObj);
      }
docs: Create a new group iterator from the given stream.