@Test
public void onError() {

    try {
        final List<Throwable> list = new ArrayList<Throwable>();
        RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
            @Override
            public void accept(Throwable t) {
                list.add(t);
            }
        });
        RxJavaPlugins.onError(new TestException("Forced failure"));
        assertEquals(1, list.size());
        assertUndeliverableTestException(list, 0, "Forced failure");
    } finally {
        RxJavaPlugins.reset();
    }
}