code: public static <T> Transformer<T, List<T>> toListWhile(
              final Func2<? super List<T>, ? super T, Boolean> condition) {
  
          Func0<List<T>> initialState = new Func0<List<T>>() {
              @Override
              public List<T> call() {
                  return new ArrayList<T>();
              }
          };
  
          Action2<List<T>, T> collect = new Action2<List<T>, T>() {
  
              @Override
              public void call(List<T> list, T n) {
                  list.add(n);
              }
          };
          return collectWhile(initialState, collect, condition);
      }
docs: <p>
  Returns a {@link Transformer} that returns an {@link Observable} that is
  a buffering of the source Observable into lists of sequential items that
  satisfy the condition {@code condition}.
  
  <p>
  <img src=
  "https://github.com/davidmoten/rxjava-extras/blob/master/src/docs/toListWhile.png?raw=true"
  alt="marble diagram">
  
  @param condition
  condition function that must return true if an item is to be
  part of the list being prepared for emission
  @param <T>
  the generic type of the source Observable
  @return transformer as above