RxPartialFunc { public static <R> Func0<R> applyEnd(final FuncN<R> funcN, final Object... args) { return new Func0<R>() { @Override public R call() { Arrays.sort(args, Collections.reverseOrder()); return funcN.call(args); } }; } private  RxPartialFunc(); static Func0<R> apply(final Func1<A, R> func1, final A first); static Func0<R> apply(final Func2<A, B, R> func2, final A first, final B second); static Func0<R> apply(final Func3<A, B, C, R> func3, final A first,
            final B second, final C third); static Func0<R> apply(final Func4<A, B, C, D, R> func4, final A first,
            final B second, final C third, final D fourth); static Func0<R> apply(final Func5<A, B, C, D, E, R> func5,
            final A first, final B second, final C third, final D fourth, final E fifth); static Func0<R> apply(final Func6<A, B, C, D, E, F, R> func6,
            final A first, final B second, final C third, final D fourth, final E fifth,
            final F sixth); static Func0<R> apply(
            final Func7<A, B, C, D, E, F, G, R> func7, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Func0<R> apply(
            final Func8<A, B, C, D, E, F, G, H, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh,
            final H eighth); static Func0<R> apply(
            final Func9<A, B, C, D, E, F, G, H, I, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh,
            final H eighth, final I ninth); static Func0<R> apply(final FuncN<R> funcN, final Object... args); static Func0<R> applyEnd(final FuncN<R> funcN, final Object... args); static Func1<T, R> apply(final Func2<A, T, R> func2, final A first); static Func1<T, R> applyEnd(final Func2<T, A, R> func2, final A first); static Func1<T, R> apply(final Func3<A, B, T, R> func3, final A first,
            final B second); static Func1<T, R> applyEnd(final Func3<T, A, B, R> func3, final A first,
            final B second); static Func1<T, R> apply(final Func4<A, B, C, T, R> func4,
            final A first, final B second, final C third); static Func1<T, R> applyEnd(final Func4<T, A, B, C, R> func4,
            final A first, final B second, final C third); static Func1<T, R> apply(final Func5<A, B, C, D, T, R> func5,
            final A first, final B second, final C third, final D fourth); static Func1<T, R> applyEnd(final Func5<T, A, B, C, D, R> func5,
            final A first, final B second, final C third, final D fourth); static Func1<T, R> apply(final Func6<A, B, C, D, E, T, R> func6,
            final A first, final B second, final C third, final D fourth, final E fifth); static Func1<T, R> applyEnd(
            final Func6<T, A, B, C, D, E, R> func6, final A first, final B second, final C third,
            final D fourth, final E fifth); static Func1<T, R> apply(
            final Func7<A, B, C, D, E, F, T, R> func7, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func1<T, R> applyEnd(
            final Func7<T, A, B, C, D, E, F, R> func7, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func1<T, R> apply(
            final Func8<A, B, C, D, E, F, G, T, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Func1<T, R> applyEnd(
            final Func8<T, A, B, C, D, E, F, G, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Func1<T, R> apply(
            final Func9<A, B, C, D, E, F, G, H, T, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh,
            final H eighth); static Func1<T, R> applyEnd(
            final Func9<T, A, B, C, D, E, F, G, H, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh,
            final H eighth); static Func2<T, U, R> apply(final Func3<A, T, U, R> func3, final A first); static Func2<T, U, R> applyEnd(final Func3<T, U, A, R> func3,
            final A first); static Func2<T, U, R> apply(final Func4<A, B, T, U, R> func4,
            final A first, final B second); static Func2<T, U, R> applyEnd(final Func4<T, U, A, B, R> func4,
            final A first, final B second); static Func2<T, U, R> apply(final Func5<A, B, C, T, U, R> func5,
            final A first, final B second, final C third); static Func2<T, U, R> applyEnd(final Func5<T, U, A, B, C, R> func5,
            final A first, final B second, final C third); static Func2<T, U, R> apply(
            final Func6<A, B, C, D, T, U, R> func6, final A first, final B second, final C third,
            final D fourth); static Func2<T, U, R> applyEnd(
            final Func6<T, U, A, B, C, D, R> func6, final A first, final B second, final C third,
            final D fourth); static Func2<T, U, R> apply(
            final Func7<A, B, C, D, E, T, U, R> func7, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func2<T, U, R> applyEnd(
            final Func7<T, U, A, B, C, D, E, R> func7, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func2<T, U, R> apply(
            final Func8<A, B, C, D, E, F, T, U, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func2<T, U, R> applyEnd(
            final Func8<T, U, A, B, C, D, E, F, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func2<T, U, R> apply(
            final Func9<A, B, C, D, E, F, G, T, U, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Func2<T, U, R> applyEnd(
            final Func9<T, U, A, B, C, D, E, F, G, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Func3<T, U, V, R> apply(final Func4<A, T, U, V, R> func4,
            final A first); static Func3<T, U, V, R> applyEnd(final Func4<T, U, V, A, R> func4,
            final A first); static Func3<T, U, V, R> apply(final Func5<A, B, T, U, V, R> func5,
            final A first, final B second); static Func3<T, U, V, R> applyEnd(
            final Func5<T, U, V, A, B, R> func5, final A first, final B second); static Func3<T, U, V, R> apply(
            final Func6<A, B, C, T, U, V, R> func6, final A first, final B second, final C third); static Func3<T, U, V, R> applyEnd(
            final Func6<T, U, V, A, B, C, R> func6, final A first, final B second, final C third); static Func3<T, U, V, R> apply(
            final Func7<A, B, C, D, T, U, V, R> func7, final A first, final B second,
            final C third, final D fourth); static Func3<T, U, V, R> applyEnd(
            final Func7<T, U, V, A, B, C, D, R> func7, final A first, final B second,
            final C third, final D fourth); static Func3<T, U, V, R> apply(
            final Func8<A, B, C, D, E, T, U, V, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func3<T, U, V, R> applyEnd(
            final Func8<T, U, V, A, B, C, D, E, R> func8, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func3<T, U, V, R> apply(
            final Func9<A, B, C, D, E, F, T, U, V, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func3<T, U, V, R> applyEnd(
            final Func9<T, U, V, A, B, C, D, E, F, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Func4<T, U, V, W, R> apply(
            final Func5<A, T, U, V, W, R> func5, final A first); static Func4<T, U, V, W, R> applyEnd(
            final Func5<T, U, V, W, A, R> func5, final A first); static Func4<T, U, V, W, R> apply(
            final Func6<A, B, T, U, V, W, R> func6, final A first, final B second); static Func4<T, U, V, W, R> applyEnd(
            final Func6<T, U, V, W, A, B, R> func6, final A first, final B second); static Func4<T, U, V, W, R> apply(
            final Func7<A, B, C, T, U, V, W, R> func7, final A first, final B second, final C third); static Func4<T, U, V, W, R> applyEnd(
            final Func7<T, U, V, W, A, B, C, R> func7, final A first, final B second, final C third); static Func4<T, U, V, W, R> apply(
            final Func8<A, B, C, D, T, U, V, W, R> func8, final A first, final B second,
            final C third, final D fourth); static Func4<T, U, V, W, R> applyEnd(
            final Func8<T, U, V, W, A, B, C, D, R> func8, final A first, final B second,
            final C third, final D fourth); static Func4<T, U, V, W, R> apply(
            final Func9<A, B, C, D, E, T, U, V, W, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func4<T, U, V, W, R> applyEnd(
            final Func9<T, U, V, W, A, B, C, D, E, R> func9, final A first, final B second,
            final C third, final D fourth, final E fifth); static Func5<T, U, V, W, X, R> apply(
            final Func6<A, T, U, V, W, X, R> func6, final A first); static Func5<T, U, V, W, X, R> applyEnd(
            final Func6<T, U, V, W, X, A, R> func6, final A first); static Func5<T, U, V, W, X, R> apply(
            final Func7<A, B, T, U, V, W, X, R> func7, final A first, final B second); static Func5<T, U, V, W, X, R> applyEnd(
            final Func7<T, U, V, W, X, A, B, R> func7, final A first, final B second); static Func5<T, U, V, W, X, R> apply(
            final Func8<A, B, C, T, U, V, W, X, R> func8, final A first, final B second,
            final C third); static Func5<T, U, V, W, X, R> applyEnd(
            final Func8<T, U, V, W, X, A, B, C, R> func8, final A first, final B second,
            final C third); static Func5<T, U, V, W, X, R> apply(
            final Func9<A, B, C, D, T, U, V, W, X, R> func9, final A first, final B second,
            final C third, final D fourth); static Func5<T, U, V, W, X, R> applyEnd(
            final Func9<T, U, V, W, X, A, B, C, D, R> func9, final A first, final B second,
            final C third, final D fourth); static Func6<T, U, V, W, X, Y, R> apply(
            final Func7<A, T, U, V, W, X, Y, R> func7, final A first); static Func6<T, U, V, W, X, Y, R> applyEnd(
            final Func7<T, U, V, W, X, Y, A, R> func7, final A first); static Func6<T, U, V, W, X, Y, R> apply(
            final Func8<A, B, T, U, V, W, X, Y, R> func8, final A first, final B second); static Func6<T, U, V, W, X, Y, R> applyEnd(
            final Func8<T, U, V, W, X, Y, A, B, R> func8, final A first, final B second); static Func6<T, U, V, W, X, Y, R> apply(
            final Func9<A, B, C, T, U, V, W, X, Y, R> func9, final A first, final B second,
            final C third); static Func6<T, U, V, W, X, Y, R> applyEnd(
            final Func9<T, U, V, W, X, Y, A, B, C, R> func9, final A first, final B second,
            final C third); static Func7<T, U, V, W, X, Y, Z, R> apply(
            final Func8<A, T, U, V, W, X, Y, Z, R> func8, final A first); static Func7<T, U, V, W, X, Y, Z, R> applyEnd(
            final Func8<T, U, V, W, X, Y, Z, A, R> func8, final A first); static Func7<T, U, V, W, X, Y, Z, R> apply(
            final Func9<A, B, T, U, V, W, X, Y, Z, R> func9, final A first, final B second); static Func7<T, U, V, W, X, Y, Z, R> applyEnd(
            final Func9<T, U, V, W, X, Y, Z, A, B, R> func9, final A first, final B second); static Func8<T, U, V, W, X, Y, Z, P, R> apply(
            final Func9<A, T, U, V, W, X, Y, Z, P, R> func9, final A first); static Func8<T, U, V, W, X, Y, Z, P, R> applyEnd(
            final Func9<T, U, V, W, X, Y, Z, P, A, R> func9, final A first);  }
@Test public void applyEnd() throws Exception { List<Class<?>> classes = Observable .from(RxPartialFunc.applyEnd(ACTION_6, 1, 2, 3).getClass().getInterfaces()) .filter(TestHelpers.classCompare(Func3.class)).toList().toBlocking().first(); Assert.assertEquals(1, classes.size()); classes = Observable .from(RxPartialFunc.applyEnd(ACTION_9, 1, 2, 3, 4, 5, 6, 7, 8).getClass() .getInterfaces()).filter(TestHelpers.classCompare(Func1.class)).toList() .toBlocking().first(); Assert.assertEquals(1, classes.size()); classes = Observable .from(RxPartialFunc .applyEnd(ACTION_N, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3).getClass() .getInterfaces()).filter(TestHelpers.classCompare(Func0.class)).toList() .toBlocking().first(); Assert.assertEquals(1, classes.size()); }