RxComprehensions { public static <A, R> Observable<R> doConcatMap( final Func0<Observable<A>> zero, final Func1<A, Observable<R>> one) { return zero.call().concatMap(new Func1<A, Observable<R>>() { @Override public Observable<R> call(final A a) { return one.call(a); } }); } private  RxComprehensions(); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<R>> one); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<R>> two); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<R>> three); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<R>> four); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<R>> five); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<R>> six); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<R>> seven); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<R>> eight); static Observable<R> doFlatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<I>> eight,
            final Func9<A, B, C, D, E, F, G, H, I, Observable<R>> nine); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<R>> one); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<R>> two); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<R>> three); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<R>> four); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<R>> five); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<R>> six); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<R>> seven); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<R>> eight); static Observable<R> doConcatMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<I>> eight,
            final Func9<A, B, C, D, E, F, G, H, I, Observable<R>> nine); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<R>> one); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<R>> two); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<R>> three); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<R>> four); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<R>> five); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<R>> six); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<R>> seven); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<R>> eight); static Observable<R> doSwitchMap(
            final Func0<Observable<A>> zero,
            final Func1<A, Observable<B>> one,
            final Func2<A, B, Observable<C>> two,
            final Func3<A, B, C, Observable<D>> three,
            final Func4<A, B, C, D, Observable<E>> four,
            final Func5<A, B, C, D, E, Observable<F>> five,
            final Func6<A, B, C, D, E, F, Observable<G>> six,
            final Func7<A, B, C, D, E, F, G, Observable<H>> seven,
            final Func8<A, B, C, D, E, F, G, H, Observable<I>> eight,
            final Func9<A, B, C, D, E, F, G, H, I, Observable<R>> nine); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, R> one); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, R> two); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, R> three); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, R> four); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, E> four,
            final Transformer<E, R> five); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, E> four,
            final Transformer<E, F> five,
            final Transformer<F, R> six); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, E> four,
            final Transformer<E, F> five,
            final Transformer<F, G> six,
            final Transformer<G, R> seven); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, E> four,
            final Transformer<E, F> five,
            final Transformer<F, G> six,
            final Transformer<G, H> seven,
            final Transformer<H, R> eight); static Observable<R> doCompose(
            final Func0<Observable<A>> zero,
            final Transformer<A, B> one,
            final Transformer<B, C> two,
            final Transformer<C, D> three,
            final Transformer<D, E> four,
            final Transformer<E, F> five,
            final Transformer<F, G> six,
            final Transformer<G, H> seven,
            final Transformer<H, I> eight,
            final Transformer<I, R> nine);  }
@Test public void twoCM() { Assert.assertEquals(RxComprehensions.doConcatMap(zero(2), one(true), two("result")).toBlocking().first(), "result"); }
@Test public void threeCM() { Assert.assertEquals( RxComprehensions.doConcatMap(zero(3), one(true), two("result"), three("other")).toBlocking().first(), "other"); }
@Test public void fourCM() { Assert.assertEquals(RxComprehensions .doConcatMap(zero(4), one(true), two("result"), three("other"), four("other".length())).toBlocking().first(), new Long("other".length())); }
@Test public void fiveCM() { Assert.assertEquals(RxComprehensions.doConcatMap(zero(1), one(true), two("result"), three("other"), four("other".length()), five("other".length() < 5)).toBlocking().first(), false); }
@Test public void sixCM() { Assert.assertEquals(RxComprehensions.doConcatMap(zero(1), one(true), two("result"), three("other"), four("other".length()), five("other".length() < 5), six(Boolean.toString(false))).toBlocking().first(), "false"); }
@Test public void sevenCM() { Assert.assertEquals( RxComprehensions .doConcatMap(zero(1), one(true), two("result"), three("other"), four("other".length()), five("other".length() < 5), six(Boolean.toString(false)), seven("true")) .toBlocking().first(), false); }
@Test public void eightCM() { Assert.assertEquals(RxComprehensions .doConcatMap(zero(1), one(true), two("result"), three("other"), four("other".length()), five("other".length() < 5), six(Boolean.toString(false)), seven("true"), eight(Long.class)) .toBlocking().first(), Long.class); }
@Test public void nineCM() { final TestSubscriber<Object> observer = TestSubscriber.create(); RxComprehensions.doConcatMap(zero(1), one(true), two("result"), three("other"), four("other".length()), five("other".length() < 5), six(Boolean.toString(false)), seven("true"), eight(Long.class), this.<Long>nine()).subscribe(observer); observer.awaitTerminalEvent(); observer.assertCompleted(); observer.assertNoErrors(); observer.assertValues(1, true, "result", "other", (long) "other".length(), "other".length() < 5, Boolean.toString(false), false, Long.class); }
@Test public void oneCM() { Assert.assertEquals(RxComprehensions.doConcatMap(zero(1), one(true)).toBlocking().first(), true); }