RxFunctions { public static <T> Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2) { return new Func1<T, T>() { @Override public T call(T t) { return func2.call(func1.call(t)); } }; } private  RxFunctions(); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4, final Func1<T, T> func5); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4, final Func1<T, T> func5,
            final Func1<T, T> func6); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4, final Func1<T, T> func5,
            final Func1<T, T> func6, final Func1<T, T> func7); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4, final Func1<T, T> func5,
            final Func1<T, T> func6, final Func1<T, T> func7, final Func1<T, T> func8); static Func1<T, T> same(final Func1<T, T> func1, final Func1<T, T> func2,
            final Func1<T, T> func3, final Func1<T, T> func4, final Func1<T, T> func5,
            final Func1<T, T> func6, final Func1<T, T> func7, final Func1<T, T> func8,
            final Func1<T, T> func9); static Func1<T, R> chain(final Func1<T, U> func1, final Func1<U, R> func2); static Func1<T, R> chain(final Func1<T, U> func1, final Func1<U, V> func2,
            final Func1<V, R> func3); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, R> func4); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, X> func4,
            final Func1<X, R> func5); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, X> func4,
            final Func1<X, Y> func5, final Func1<Y, R> func6); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, X> func4,
            final Func1<X, Y> func5, final Func1<Y, Z> func6, final Func1<Z, R> func7); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, X> func4,
            final Func1<X, Y> func5, final Func1<Y, Z> func6, final Func1<Z, A> func7,
            final Func1<A, R> func8); static Func1<T, R> chain(final Func1<T, U> func1,
            final Func1<U, V> func2, final Func1<V, W> func3, final Func1<W, X> func4,
            final Func1<X, Y> func5, final Func1<Y, Z> func6, final Func1<Z, A> func7,
            final Func1<A, B> func8, final Func1<B, R> func9); static Func1<T, R> combine(final Func1<T, U> func1, final Func1<T, V> func2,
            final Func2<U, V, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func3<U, V, W, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func1<T, X> func4,
            final Func4<U, V, W, X, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func1<T, X> func4,
            final Func1<T, Y> func5, final Func1<T, Z> func6,
            final Func6<U, V, W, X, Y, Z, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func1<T, X> func4,
            final Func1<T, Y> func5, final Func1<T, Z> func6, final Func1<T, A> func7,
            final Func7<U, V, W, X, Y, Z, A, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func1<T, X> func4,
            final Func1<T, Y> func5, final Func1<T, Z> func6, final Func1<T, A> func7,
            final Func1<T, B> func8, final Func8<U, V, W, X, Y, Z, A, B, R> funcResult); static Func1<T, R> combine(final Func1<T, U> func1,
            final Func1<T, V> func2, final Func1<T, W> func3, final Func1<T, X> func4,
            final Func1<T, Y> func5, final Func1<T, Z> func6, final Func1<T, A> func7,
            final Func1<T, B> func8, final Func1<T, C> func9,
            final Func9<U, V, W, X, Y, Z, A, B, C, R> funcResult); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4, final Func1<T, R> func5); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4, final Func1<T, R> func5, final Func1<T, R> func6); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4, final Func1<T, R> func5, final Func1<T, R> func6,
            final Func1<T, R> func7); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4, final Func1<T, R> func5, final Func1<T, R> func6,
            final Func1<T, R> func7, final Func1<T, R> func8); @SuppressWarnings("unchecked") static Func1<T, R> reduce(final R initial, final Func2<R, R, R> compose,
            final Func1<T, R> func1, final Func1<T, R> func2, final Func1<T, R> func3,
            final Func1<T, R> func4, final Func1<T, R> func5, final Func1<T, R> func6,
            final Func1<T, R> func7, final Func1<T, R> func8, final Func1<T, R> func9); static Func1<T, Boolean> not(final Func1<T, Boolean> func1); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7,
            final Func1<T, Boolean> func8); @SuppressWarnings("unchecked") static Func1<T, Boolean> and(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7,
            final Func1<T, Boolean> func8, final Func1<T, Boolean> func9); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7,
            final Func1<T, Boolean> func8); @SuppressWarnings("unchecked") static Func1<T, Boolean> or(final Func1<T, Boolean> func1,
            final Func1<T, Boolean> func2, final Func1<T, Boolean> func3,
            final Func1<T, Boolean> func4, final Func1<T, Boolean> func5,
            final Func1<T, Boolean> func6, final Func1<T, Boolean> func7,
            final Func1<T, Boolean> func8, final Func1<T, Boolean> func9);  }
@Test public void testSame() throws Exception { final int start = 0; int separate = INCREMENT.call(INCREMENT.call(INCREMENT.call(INCREMENT.call(start)))); int chain = RxFunctions.same(INCREMENT, INCREMENT, INCREMENT, INCREMENT).call(start); Assert.assertEquals(separate, chain); }