src/main/java/io/reactivex/Flowable.java
@SuppressWarnings({ "unchecked", "rawtypes" })
    @CheckReturnValue
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> switchOnNext(Publisher<? extends Publisher<? extends T>> sources, int bufferSize) {
        return fromPublisher(sources).switchMap((Function)Functions.identity(), bufferSize);
    }
@SuppressWarnings({ "unchecked", "rawtypes" })
    @CheckReturnValue
    @BackpressureSupport(BackpressureKind.FULL)
    @SchedulerSupport(SchedulerSupport.NONE)
    public static <T> Flowable<T> switchOnNext(Publisher<? extends Publisher<? extends T>> sources, int bufferSize) {
        return fromPublisher(sources).switchMap((Function)Functions.identity(), bufferSize);
    }
Converts a Publisher that emits Publishers into a Publisher that emits the items emitted by the
most recently emitted of those Publishers.
<p>
<img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchDo.png" alt="">
<p>
{@code switchOnNext} subscribes to a Publisher that emits Publishers. Each time it observes one of
these emitted Publishers, the Publisher returned by {@code switchOnNext} begins emitting the items
emitted by that Publisher. When a new Publisher is emitted, {@code switchOnNext} stops emitting items
from the earlier-emitted Publisher and begins emitting items from the new one.
<p>
The resulting Publisher completes if both the outer Publisher and the last inner Publisher, if any, complete.
If the outer Publisher signals an onError, the inner Publisher is canceled and the error delivered in-sequence.
<dl>
<dt><b>Backpressure:</b></dt>
<dd>The operator honors backpressure from downstream. The outer {@code Publisher} is consumed in an
unbounded manner (i.e., without backpressure) and the inner {@code Publisher}s are expected to honor
backpressure but it is not enforced; the operator won't signal a {@code MissingBackpressureException}
but the violation <em>may</em> lead to {@code OutOfMemoryError} due to internal buffer bloat.</dd>
<dt><b>Scheduler:</b></dt>
<dd>{@code switchOnNext} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>

@param <T> the item type
@param sources
the source Publisher that emits Publishers
@param bufferSize
the number of items to prefetch from the inner Publishers
@return a Flowable that emits the items emitted by the Publisher most recently emitted by the source
Publisher
@see <a href="http://reactivex.io/documentation/operators/switch.html">ReactiveX operators documentation: Switch</a>