class BufferedPublisher extends BasePublisher<T> {

  public boolean accept(final T t) {
    checkContext();
    if (isComplete() || hasSentComplete()) {
      throw new IllegalStateException("Cannot call accept after complete is called");
    }
    if (!isCancelled() && !isFailed()) {
      if (getDemand() == 0) {
        buffer.add(t);
      } else {
        doOnNext(t);
      }
    }
    return buffer.size() >= bufferMaxSize;
  }

  public  BufferedPublisher(final Context ctx);
  public  BufferedPublisher(final Context ctx, final Collection<T> initialBuffer);
  public  BufferedPublisher(final Context ctx, final int bufferMaxSize);

}