code: public static <T, R> FlowableTransformer<T, R> collectWhile(final Callable<R> collectionFactory,
              final BiFunction<? super R, ? super T, ? extends R> add, final BiPredicate<? super R, ? super T> condition,
              final boolean emitRemainder) {
          return new FlowableTransformer<T, R>() {
  
              @Override
              public Publisher<R> apply(Flowable<T> source) {
                  return new FlowableCollectWhile<T, R>(source, collectionFactory, add, condition, emitRemainder);
              }
          };
      }
docs: Returns a transformer that emits collections of items with the collection
  boundaries determined by the given {@link BiPredicate}.
  
  <p>
  <img src=
  "https://raw.githubusercontent.com/davidmoten/rxjava2-extras/master/src/docs/collectWhile.png"
  alt="image">
  
  @param collectionFactory
  factory to create a new collection
  @param add
  method to add an item to a collection
  @param condition
  while true will continue to add to the current collection. Do not
  modify the given collection!
  @param emitRemainder
  whether to emit the remainder as a collection
  @param <T>
  item type
  @param <R>
  collection type
  @return transform that collects while some conditions is returned then starts
  a new collection