src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U> Single<U> collectInto(final U initialValue, BiConsumer<? super U, ? super T> collector) {
        ObjectHelper.requireNonNull(initialValue, "initialValue is null");
        return collect(Functions.justCallable(initialValue), collector);
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <U> Single<U> collectInto(final U initialValue, BiConsumer<? super U, ? super T> collector) {
        ObjectHelper.requireNonNull(initialValue, "initialValue is null");
        return collect(Functions.justCallable(initialValue), collector);
    }
Collects items emitted by the finite source ObservableSource into a single mutable data structure and returns
a Single that emits this structure.
<p>
<img width="640" height="330" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/collectInto.o.png" alt="">
<p>
This is a simplified version of {@code reduce} that does not need to return the state on each pass.
<p>
Note that this operator requires the upstream to signal {@code onComplete} for the accumulator object 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>Scheduler:</b></dt>
<dd>{@code collectInto} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <U> the accumulator and output type
@param initialValue
the mutable data structure that will collect the items
@param collector
a function that accepts the {@code state} and an emitted item, and modifies {@code state}
accordingly
@return a Single that emits the result of collecting the values emitted by the source ObservableSource
into a single mutable data structure
@see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>