@Test
public void selectorInnerError() {

    PublishProcessor<Integer> pp = PublishProcessor.create();
    pp.publish(new Function<Flowable<Integer>, Flowable<Integer>>() {
        @Override
        public Flowable<Integer> apply(Flowable<Integer> v) throws Exception {
            return Flowable.error(new TestException());
        }
    })
    .test()
    .assertFailure(TestException.class);
    assertFalse(pp.hasSubscribers());
}