private @NotNull Runnable createConsumerRunnable(final long ts) {
    return () -> {
      final List<T> list;
      synchronized (myFlushLock) {
        myTs = ts;
        myPendingFlush = false;
        if (myBuffer.isEmpty()) return;
        list = myBuffer;
        myBuffer = new ArrayList<>(mySize);
      }
      myConsumer.consume(list);
    };
  }
private @NotNull Runnable createConsumerRunnable(final long ts)