@Test
public void testColdReplayBackpressure() {

    Flowable<Integer> source = Flowable.range(0, 1000).replay().autoConnect();
    TestSubscriber<Integer> ts = new TestSubscriber<Integer>(0L);
    ts.request(10);
    source.subscribe(ts);
    ts.assertNoErrors();
    ts.assertNotComplete();
    List<Integer> onNextEvents = ts.values();
    assertEquals(10, onNextEvents.size());
    for (int i = 0; i < 10; i++) {
        assertEquals((Integer)i, onNextEvents.get(i));
    }
    ts.dispose();
}