@Test
public void testBackpressureFastSlow() {

    ConnectableObservable<Integer> is = Observable.range(1, Flowable.bufferSize() * 2).publish();
    Observable<Integer> fast = is.observeOn(Schedulers.computation())
    .doOnComplete(new Action() {
        @Override
        public void run() {
            System.out.println("^^^^^^^^^^^^^ completed FAST");
        }
    });
    Observable<Integer> slow = is.observeOn(Schedulers.computation()).map(new Function<Integer, Integer>() {
        int c;
        @Override
        public Integer apply(Integer i) {
            if (c == 0) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                }
            }
            c++;
            return i;
        }
    }).doOnComplete(new Action() {
        @Override
        public void run() {
            System.out.println("^^^^^^^^^^^^^ completed SLOW");
        }
    });
    TestObserver<Integer> to = new TestObserver<Integer>();
    Observable.merge(fast, slow).subscribe(to);
    is.connect();
    to.awaitTerminalEvent();
    to.assertNoErrors();
    assertEquals(Flowable.bufferSize() * 4, to.valueCount());
}