@Test
public void scalarReentrant2() {

    final PublishProcessor<Flowable<Integer>> pp = PublishProcessor.create();
    TestSubscriber<Integer> ts = new TestSubscriber<Integer>() {
        @Override
        public void onNext(Integer t) {
            super.onNext(t);
            if (t == 1) {
                pp.onNext(Flowable.just(2));
            }
        }
    };
    Flowable.merge(pp, 2)
    .subscribe(ts);
    pp.onNext(Flowable.just(1));
    pp.onComplete();
    ts.assertResult(1, 2);
}