@Test
public void testNoMissingBackpressureException() {

    final int m = 4 * 1000 * 1000;
    Observable<Integer> firehose = Observable.unsafeCreate(new ObservableSource<Integer>() {
        @Override
        public void subscribe(Observer<? super Integer> t) {
            t.onSubscribe(Disposables.empty());
            for (int i = 0; i < m; i++) {
                t.onNext(i);
            }
            t.onComplete();
        }
    });
    TestObserver<Integer> to = new TestObserver<Integer>();
    firehose.replay().autoConnect().observeOn(Schedulers.computation()).takeLast(100).subscribe(to);
    to.awaitTerminalEvent(3, TimeUnit.SECONDS);
    to.assertNoErrors();
    to.assertTerminated();
    assertEquals(100, to.values().size());
}