@Test
public void onError() throws Exception {

    List<Throwable> errors = TestHelper.trackPluginErrors();
    try {
        fs.onError(new TestException("One"));
        fs.onError(new TestException("Two"));
        try {
            fs.get(5, TimeUnit.MILLISECONDS);
        } catch (ExecutionException ex) {
            assertTrue(ex.toString(), ex.getCause() instanceof TestException);
            assertEquals("One", ex.getCause().getMessage());
        }
        TestHelper.assertUndeliverable(errors, 0, TestException.class, "Two");
    } finally {
        RxJavaPlugins.reset();
    }
}