RxCurryingAction { public static <A, B> Func1<A, Action1<B>> curry(final Action2<A, B> action) { return new Func1<A, Action1<B>>() { @Override public Action1<B> call(final A a) { return new Action1<B>() { @Override public void call(final B b) { action.call(a, b); } }; } }; } private  RxCurryingAction(); static Func1<A, Action1<B>> curry(final Action2<A, B> action); static Func1<A, Func1<B, Action1<C>>> curry(final Action3<A, B, C> action); static Func1<A, Func1<B, Func1<C, Action1<D>>>> curry(
            final Action4<A, B, C, D> action); static Func1<A, Func1<B, Func1<C, Func1<D, Action1<E>>>>> curry(
            final Action5<A, B, C, D, E> action); static Func1<A, Func1<B, Func1<C, Func1<D, Func1<E, Action1<F>>>>>> curry(
            final Action6<A, B, C, D, E, F> action); static Func1<A, Func1<B, Func1<C, Func1<D, Func1<E, Func1<F, Action1<G>>>>>>> curry(
            final Action7<A, B, C, D, E, F, G> action); static Func1<A, Func1<B, Func1<C, Func1<D, Func1<E, Func1<F, Func1<G, Action1<H>>>>>>>> curry(
            final Action8<A, B, C, D, E, F, G, H> action); static Func1<A, Func1<B, Func1<C, Func1<D, Func1<E, Func1<F, Func1<G, Func1<H, Action1<I>>>>>>>>> curry(
            final Action9<A, B, C, D, E, F, G, H, I> action);  }
@Test public void curry() throws Exception { Func1<Integer, Action1<Integer>> variable = RxCurryingAction .curry(new Action2<Integer, Integer>() { @Override public void call(Integer first, Integer second) { Assert.assertEquals(5, first + second); } }); Action1<Integer> firstForm = variable.call(3); firstForm.call(2); }