src/main/java/io/reactivex/Flowable.java
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @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 FlowableReduceWithSingle<T, R>(this, seedSupplier, reducer));
    }
@CheckReturnValue
    @NonNull
    @BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
    @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 FlowableReduceWithSingle<T, R>(this, seedSupplier, reducer));
    }
Returns a Single that applies a specified accumulator function to the first item emitted by a source
Publisher and a seed value derived from calling a specified seedSupplier, then feeds the result
of that function along with the second item emitted by a Publisher into the same function, and so on until
all items have been emitted by the finite source Publisher, 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/reduceSeed.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>Backpressure:</b></dt>
<dd>The operator honors backpressure of its downstream consumer and consumes the
upstream source in unbounded mode.</dd>
<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 Subscriber
@param reducer
an accumulator function to be invoked on each item emitted by the source Publisher, 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 Publisher
@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>