@Override
  public BiConsumer<List<List<T>>, T> accumulator() {
    return (lists, t) -> {
      buffer.offer(t);
      ++totalIn;
      if (buffer.size() == window) {
        dumpCurrent(lists);
        shiftBy(step);
      }
    };
  }
this class is copied and modified from <a
href="https://github.com/ggalmazor/lt_downsampling_java8">...</a> project
library-udf/src/main/java/org/apache/iotdb/library/dprofile/util/SlidingCollector.java