src/main/java/io/reactivex/Observable.java
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Single<R> reduceWith(Callable<R> seedSupplier, BiFunction<R, ? super T, R> reducer) {
        ObjectHelper.requireNonNull(seedSupplier, "seedSupplier is null");
        ObjectHelper.requireNonNull(reducer, "reducer is null");
        return RxJavaPlugins.onAssembly(new ObservableReduceWithSingle<T, R>(this, seedSupplier, reducer));
    }
@CheckReturnValue
    @SchedulerSupport(SchedulerSupport.NONE)
    public final <R> Single<R> reduceWith(Callable<R> seedSupplier, BiFunction<R, ? super T, R> reducer) {
        ObjectHelper.requireNonNull(seedSupplier, "seedSupplier is null");
        ObjectHelper.requireNonNull(reducer, "reducer is null");
        return RxJavaPlugins.onAssembly(new ObservableReduceWithSingle<T, R>(this, seedSupplier, reducer));
    }
Returns a Single that applies a specified accumulator function to the first item emitted by a source
ObservableSource and a seed value derived from calling a specified seedSupplier, then feeds the result
of that function along with the second item emitted by an ObservableSource into the same function,
and so on until all items have been emitted by the finite source ObservableSource, emitting the final result
from the final call to your function as its sole item.
<p>
<img width="640" height="325" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/reduceWith.o.png" alt="">
<p>
This technique, which is called "reduce" here, is sometimes called "aggregate," "fold," "accumulate,"
"compress," or "inject" in other programming contexts. Groovy, for instance, has an {@code inject} method
that does a similar operation on lists.
<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 reduceWith} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <R> the accumulator and output value type
@param seedSupplier
the Callable that provides the initial (seed) accumulator value for each individual Observer
@param reducer
an accumulator function to be invoked on each item emitted by the source ObservableSource, the
result of which will be used in the next accumulator call
@return a Single that emits a single item that is the result of accumulating the output from the
items emitted by the source ObservableSource
@see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>
@see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>