@Test
public void testSkipAndCountBuffersWithGaps() {

    Observable<String> source = Observable.create(new Observable.OnSubscribeFunc<String>() {
        @Override
        public Subscription onSubscribe(Observer<? super String> observer) {
            observer.onNext("one");
            observer.onNext("two");
            observer.onNext("three");
            observer.onNext("four");
            observer.onNext("five");
            observer.onCompleted();
            return Subscriptions.empty();
        }
    });
    Observable<List<String>> buffered = Observable.create(buffer(source, 2, 3));
    buffered.subscribe(observer);
    InOrder inOrder = Mockito.inOrder(observer);
    inOrder.verify(observer, Mockito.times(1)).onNext(list("one", "two"));
    inOrder.verify(observer, Mockito.times(1)).onNext(list("four", "five"));
    inOrder.verify(observer, Mockito.never()).onNext(Mockito.anyListOf(String.class));
    inOrder.verify(observer, Mockito.never()).onError(Mockito.any(Throwable.class));
    inOrder.verify(observer, Mockito.times(1)).onCompleted();
}