RxPartialAction { static Action0 applyEnd(final ActionN actionN, final Object... args) { return new Action0() { @Override public void call() { Arrays.sort(args, Collections.reverseOrder()); actionN.call(args); } }; } private  RxPartialAction(); static Action0 apply(final Action1<A> action1, final A first); static Action0 apply(final Action2<A, B> action2, final A first, final B second); static Action0 apply(final Action3<A, B, C> action3, final A first,
            final B second, final C third); static Action0 apply(final Action4<A, B, C, D> action4, final A first,
            final B second, final C third, final D fourth); static Action0 apply(final Action5<A, B, C, D, E> action5,
            final A first, final B second, final C third, final D fourth, final E fifth); static Action0 apply(final Action6<A, B, C, D, E, F> action6,
            final A first, final B second, final C third, final D fourth, final E fifth,
            final F sixth); static Action0 apply(final Action7<A, B, C, D, E, F, G> action7,
            final A first, final B second, final C third, final D fourth, final E fifth,
            final F sixth, final G seventh); static Action0 apply(
            final Action8<A, B, C, D, E, F, G, H> action8, 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 Action0 apply(
            final Action9<A, B, C, D, E, F, G, H, I> action9, 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 Action1<T> apply(final Action2<A, T> action2, final A first); static Action1<T> applyEnd(final Action2<T, A> action2, final A first); static Action1<T> apply(final Action3<A, B, T> action3, final A first,
            final B second); static Action1<T> applyEnd(final Action3<T, A, B> action3, final A first,
            final B second); static Action1<T> apply(final Action4<A, B, C, T> action4, final A first,
            final B second, final C third); static Action1<T> applyEnd(final Action4<T, A, B, C> action4,
            final A first, final B second, final C third); static Action1<T> apply(final Action5<A, B, C, D, T> action5,
            final A first, final B second, final C third, final D fourth); static Action1<T> applyEnd(final Action5<T, A, B, C, D> action5,
            final A first, final B second, final C third, final D fourth); static Action1<T> apply(final Action6<A, B, C, D, E, T> action6,
            final A first, final B second, final C third, final D fourth, final E fifth); static Action1<T> applyEnd(final Action6<T, A, B, C, D, E> action6,
            final A first, final B second, final C third, final D fourth, final E fifth); static Action1<T> apply(
            final Action7<A, B, C, D, E, F, T> action7, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action1<T> applyEnd(
            final Action7<T, A, B, C, D, E, F> action7, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action1<T> apply(
            final Action8<A, B, C, D, E, F, G, T> action8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Action1<T> applyEnd(
            final Action8<T, A, B, C, D, E, F, G> action8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Action1<T> apply(
            final Action9<A, B, C, D, E, F, G, H, T> action9, 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 Action1<T> applyEnd(
            final Action9<T, A, B, C, D, E, F, G, H> action9, 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 Action2<T, U> apply(final Action3<A, T, U> action3, final A first); static Action2<T, U> applyEnd(final Action3<T, U, A> action3, final A first); static Action2<T, U> apply(final Action4<A, B, T, U> action4,
            final A first, final B second); static Action2<T, U> applyEnd(final Action4<T, U, A, B> action4,
            final A first, final B second); static Action2<T, U> apply(final Action5<A, B, C, T, U> action5,
            final A first, final B second, final C third); static Action2<T, U> applyEnd(final Action5<T, U, A, B, C> action5,
            final A first, final B second, final C third); static Action2<T, U> apply(final Action6<A, B, C, D, T, U> action6,
            final A first, final B second, final C third, final D fourth); static Action2<T, U> applyEnd(
            final Action6<T, U, A, B, C, D> action6, final A first, final B second, final C third,
            final D fourth); static Action2<T, U> apply(
            final Action7<A, B, C, D, E, T, U> action7, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action2<T, U> applyEnd(
            final Action7<T, U, A, B, C, D, E> action7, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action2<T, U> apply(
            final Action8<A, B, C, D, E, F, T, U> action8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action2<T, U> applyEnd(
            final Action8<T, U, A, B, C, D, E, F> action8, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action2<T, U> apply(
            final Action9<A, B, C, D, E, F, G, T, U> action9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Action2<T, U> applyEnd(
            final Action9<T, U, A, B, C, D, E, F, G> action9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth, final G seventh); static Action3<T, U, V> apply(final Action4<A, T, U, V> action4,
            final A first); static Action3<T, U, V> applyEnd(final Action4<T, U, V, A> action4,
            final A first); static Action3<T, U, V> apply(final Action5<A, B, T, U, V> action5,
            final A first, final B second); static Action3<T, U, V> applyEnd(final Action5<T, U, V, A, B> action5,
            final A first, final B second); static Action3<T, U, V> apply(
            final Action6<A, B, C, T, U, V> action6, final A first, final B second, final C third); static Action3<T, U, V> applyEnd(
            final Action6<T, U, V, A, B, C> action6, final A first, final B second, final C third); static Action3<T, U, V> apply(
            final Action7<A, B, C, D, T, U, V> action7, final A first, final B second,
            final C third, final D fourth); static Action3<T, U, V> applyEnd(
            final Action7<T, U, V, A, B, C, D> action7, final A first, final B second,
            final C third, final D fourth); static Action3<T, U, V> apply(
            final Action8<A, B, C, D, E, T, U, V> action8, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action3<T, U, V> applyEnd(
            final Action8<T, U, V, A, B, C, D, E> action8, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action3<T, U, V> apply(
            final Action9<A, B, C, D, E, F, T, U, V> action9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action3<T, U, V> applyEnd(
            final Action9<T, U, V, A, B, C, D, E, F> action9, final A first, final B second,
            final C third, final D fourth, final E fifth, final F sixth); static Action4<T, U, V, W> apply(final Action5<A, T, U, V, W> action5,
            final A first); static Action4<T, U, V, W> applyEnd(
            final Action5<T, U, V, W, A> action5, final A first); static Action4<T, U, V, W> apply(
            final Action6<A, B, T, U, V, W> action6, final A first, final B second); static Action4<T, U, V, W> applyEnd(
            final Action6<T, U, V, W, A, B> action6, final A first, final B second); static Action4<T, U, V, W> apply(
            final Action7<A, B, C, T, U, V, W> action7, final A first, final B second, final C third); static Action4<T, U, V, W> applyEnd(
            final Action7<T, U, V, W, A, B, C> action7, final A first, final B second, final C third); static Action4<T, U, V, W> apply(
            final Action8<A, B, C, D, T, U, V, W> action8, final A first, final B second,
            final C third, final D fourth); static Action4<T, U, V, W> applyEnd(
            final Action8<T, U, V, W, A, B, C, D> action8, final A first, final B second,
            final C third, final D fourth); static Action4<T, U, V, W> apply(
            final Action9<A, B, C, D, E, T, U, V, W> action9, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action4<T, U, V, W> applyEnd(
            final Action9<T, U, V, W, A, B, C, D, E> action9, final A first, final B second,
            final C third, final D fourth, final E fifth); static Action5<T, U, V, W, X> apply(
            final Action6<A, T, U, V, W, X> action6, final A first); static Action5<T, U, V, W, X> applyEnd(
            final Action6<T, U, V, W, X, A> action6, final A first); static Action5<T, U, V, W, X> apply(
            final Action7<A, B, T, U, V, W, X> action7, final A first, final B second); static Action5<T, U, V, W, X> applyEnd(
            final Action7<T, U, V, W, X, A, B> action7, final A first, final B second); static Action5<T, U, V, W, X> apply(
            final Action8<A, B, C, T, U, V, W, X> action8, final A first, final B second,
            final C third); static Action5<T, U, V, W, X> applyEnd(
            final Action8<T, U, V, W, X, A, B, C> action8, final A first, final B second,
            final C third); static Action5<T, U, V, W, X> apply(
            final Action9<A, B, C, D, T, U, V, W, X> action9, final A first, final B second,
            final C third, final D fourth); static Action5<T, U, V, W, X> applyEnd(
            final Action9<T, U, V, W, X, A, B, C, D> action9, final A first, final B second,
            final C third, final D fourth); static Action6<T, U, V, W, X, Y> apply(
            final Action7<A, T, U, V, W, X, Y> action7, final A first); static Action6<T, U, V, W, X, Y> applyEnd(
            final Action7<T, U, V, W, X, Y, A> action7, final A first); static Action6<T, U, V, W, X, Y> apply(
            final Action8<A, B, T, U, V, W, X, Y> action8, final A first, final B second); static Action6<T, U, V, W, X, Y> applyEnd(
            final Action8<T, U, V, W, X, Y, A, B> action8, final A first, final B second); static Action6<T, U, V, W, X, Y> apply(
            final Action9<A, B, C, T, U, V, W, X, Y> action9, final A first, final B second,
            final C third); static Action6<T, U, V, W, X, Y> applyEnd(
            final Action9<T, U, V, W, X, Y, A, B, C> action9, final A first, final B second,
            final C third); static Action7<T, U, V, W, X, Y, Z> apply(
            final Action8<A, T, U, V, W, X, Y, Z> action8, final A first); static Action7<T, U, V, W, X, Y, Z> applyEnd(
            final Action8<T, U, V, W, X, Y, Z, A> action8, final A first); static Action7<T, U, V, W, X, Y, Z> apply(
            final Action9<A, B, T, U, V, W, X, Y, Z> action9, final A first, final B second); static Action7<T, U, V, W, X, Y, Z> applyEnd(
            final Action9<T, U, V, W, X, Y, Z, A, B> action9, final A first, final B second); static Action8<T, U, V, W, X, Y, Z, P> apply(
            final Action9<A, T, U, V, W, X, Y, Z, P> action9, final A first); static Action8<T, U, V, W, X, Y, Z, P> applyEnd(
            final Action9<T, U, V, W, X, Y, Z, P, A> action9, final A first);  }
@Test public void applyEnd() throws Exception { List<Class<?>> classes = Observable .from(RxPartialAction.applyEnd(ACTION_6, 1, 2, 3).getClass().getInterfaces()) .filter(TestHelpers.classCompare(Action3.class)).toList().toBlocking().first(); Assert.assertEquals(1, classes.size()); classes = Observable .from(RxPartialAction.applyEnd(ACTION_9, 1, 2, 3, 4, 5, 6, 7, 8).getClass() .getInterfaces()).filter(TestHelpers.classCompare(Action1.class)).toList() .toBlocking().first(); Assert.assertEquals(1, classes.size()); classes = Observable .from(RxPartialAction .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(Action0.class)).toList() .toBlocking().first(); Assert.assertEquals(1, classes.size()); }