@Test
public void taskCrash() throws Exception {

    ExecutorService exec = Executors.newSingleThreadExecutor();
    List<Throwable> errors = TestHelper.trackPluginErrors();
    try {
        InstantPeriodicTask task = new InstantPeriodicTask(new Runnable() {
            @Override
            public void run() {
                throw new TestException();
            }
        }, exec);
        assertNull(task.call());
        TestHelper.assertUndeliverable(errors, 0, TestException.class);
    } finally {
        exec.shutdownNow();
        RxJavaPlugins.reset();
    }
}