@Test
public void testInfiniteRequestSome() {

    int count = 100;
    AbstractOnSubscribe<Integer, Void> aos = new AbstractOnSubscribe<Integer, Void>() {
        @Override
        protected void next(SubscriptionState<Integer, Void> state) {
            state.onNext((int)state.calls());
        }
    };
    
    @SuppressWarnings("unchecked")
    Observer<Object> o = mock(Observer.class);
    InOrder inOrder = inOrder(o);
    
    TestSubscriber<Object> ts = new TestSubscriber<Object>(o) {
        @Override
        public void onStart() {
            requestMore(0); // don't start right away
        }
    };
    
    aos.toObservable().subscribe(ts);
    
    ts.requestMore(count);
    
    verify(o, never()).onError(any(Throwable.class));
    verify(o, never()).onCompleted();
    for (int i = 0; i < count; i++) {
        inOrder.verify(o).onNext(i);
    }
    inOrder.verifyNoMoreInteractions();
}