RxActions { public static <T> Action1<T> act(final Action1<T> action1, final Action1<T> action2) { return new Action1<T>() { @Override public void call(T t) { action1.call(t); action2.call(t); } }; } RxActions(); static Action1<T> act(final Action1<T> action1, final Action1<T> action2); static Action1<T> act(final Action1<T> action1, final Action1<T> action2,
            final Action1<T> action3); static Action1<T> act(final Action1<T> action1, final Action1<T> action2,
            final Action1<T> action3, final Action1<T> action4); static Action1<T> act(final Action1<T> action1, final Action1<T> action2,
            final Action1<T> action3, final Action1<T> action4, final Action1<T> action5); static Action1<T> act(final Action1<T>... actions); static Action0 act(final Action0 action1, final Action0 action2); static Action0 act(final Action0 action1, final Action0 action2, final Action0 action3); static Action0 act(final Action0 action1, final Action0 action2, final Action0 action3,
            final Action0 action4); static Action0 act(final Action0 action1, final Action0 action2, final Action0 action3,
            final Action0 action4, final Action0 action5); static Action0 act(final Action0... actions);  }
@Test public void testWarmup() throws Exception { Observable .just(1) .doOnNext(RxActions.act(doAction(sum), doAction(sum), doAction(sum))) .subscribe( RxActions.act(doAction(sum), doAction(sum)), RxActions.act(doError(arrayError), doError(arrayError), doError(arrayError), doError(arrayError), doError(arrayError), doError(arrayError)), RxActions.act(doComplete(sum), doComplete(sum), doComplete(sum), doComplete(sum))); Assert.assertEquals(9, sum[0]); Assert.assertEquals(6, arrayError.size()); }