@Test
public void testFlatMapTransformsOnErrorFuncThrows() {

    Flowable<Integer> onNext = Flowable.fromIterable(Arrays.asList(1, 2, 3));
    Flowable<Integer> onComplete = Flowable.fromIterable(Arrays.asList(4));
    Flowable<Integer> onError = Flowable.fromIterable(Arrays.asList(5));
    Flowable<Integer> source = Flowable.error(new TestException());
    Subscriber<Object> o = TestHelper.mockSubscriber();
    source.flatMap(just(onNext), funcThrow((Throwable) null, onError), just0(onComplete)).subscribe(o);
    verify(o).onError(any(CompositeException.class));
    verify(o, never()).onNext(any());
    verify(o, never()).onComplete();
}