### Question:
SingleOnErrorResume extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new OnErrorResumeSubscriber<>(subscriber, fallbackFunction)); } SingleOnErrorResume(Single<T> source,
                        Function<? super Throwable, ? extends T> fallbackFunction); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }### Answer:
@Test public void fallbackFunctionCrash() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.<Integer>error(new IOException()) .onErrorResume(e -> { throw new IllegalArgumentException(); }) .subscribe(ts); ts.assertFailure(IllegalArgumentException.class); assertThat(ts.getLastError().getSuppressed()[0], instanceOf(IOException.class)); }
@Test public void emptySource() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.<Integer>empty() .onErrorResume(Object::hashCode) .subscribe(ts); ts.assertResult(); }
@Test public void noSelfSuppressionFailure() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.<Integer>error(new IllegalArgumentException()) .onErrorResume(e -> { throw (IllegalArgumentException)e; }) .subscribe(ts); ts.assertFailure(IllegalArgumentException.class); }