@Test
public void testComplete() {

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