code: public ChannelFlushPromiseNotifier add(ChannelPromise promise, long pendingDataSize) {
          if (promise == null) {
              throw new NullPointerException("promise");
          }
          checkPositiveOrZero(pendingDataSize, "pendingDataSize");
          long checkpoint = writeCounter + pendingDataSize;
          if (promise instanceof FlushCheckpoint) {
              FlushCheckpoint cp = (FlushCheckpoint) promise;
              cp.flushCheckpoint(checkpoint);
              flushCheckpoints.add(cp);
          } else {
              flushCheckpoints.add(new DefaultFlushCheckpoint(checkpoint, promise));
          }
          return this;
      }
docs: Add a {@link ChannelPromise} to this {@link ChannelFlushPromiseNotifier} which will be notified after the given
  {@code pendingDataSize} was reached.