src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U extends Collection<? super T>> Single<U> toList(Callable<U> collectionSupplier) {
        ObjectHelper.requireNonNull(collectionSupplier, "collectionSupplier is null");
        return RxJavaPlugins.onAssembly(new FlowableToListSingle<T, U>(this, collectionSupplier));
    }
@CheckReturnValue
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U extends Collection<? super T>> Single<U> toList(Callable<U> collectionSupplier) {
        ObjectHelper.requireNonNull(collectionSupplier, "collectionSupplier is null");
        return RxJavaPlugins.onAssembly(new FlowableToListSingle<T, U>(this, collectionSupplier));
    }
Returns a Single that emits a single item, a list composed of all the items emitted by the
finite source Publisher.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="">
<p>
Normally, a Publisher that returns multiple items will do so by invoking its {@link Subscriber}'s
{@link Subscriber#onNext onNext} method for each such item. You can change this behavior, instructing the
Publisher to compose a list of all of these items and then to invoke the Subscriber's {@code onNext}
function once, passing it the entire list, by calling the Publisher's {@code toList} method prior to
calling its {@link #subscribe} method.
<p>
Note that this operator requires the upstream to signal {@code onComplete} for the accumulated collection to
be emitted. Sources that are infinite and never complete will never emit anything through this
operator and an infinite source may lead to a fatal {@code OutOfMemoryError}.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure from downstream and consumes the source {@code Publisher} in an
unbounded manner (i.e., without applying backpressure to it).</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code toList} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the subclass of a collection of Ts
@param collectionSupplier
the Callable returning the collection (for each individual Subscriber) to be filled in
@return a Single that emits a single item: a List containing all of the items emitted by the source
Publisher
@see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>