@Test
public void testScanIntegersWithoutInitialValueAndOnlyOneValue() {

    @SuppressWarnings("unchecked")
    Observer<Integer> observer = mock(Observer.class);
    Observable<Integer> observable = Observable.from(1);
    Observable<Integer> m = Observable.create(scan(observable, new Func2<Integer, Integer, Integer>() {
        @Override
        public Integer call(Integer t1, Integer t2) {
            return t1 + t2;
        }
    }));
    m.subscribe(observer);
    verify(observer, never()).onError(any(Throwable.class));
    verify(observer, never()).onNext(0);
    verify(observer, times(1)).onNext(1);
    verify(observer, times(1)).onNext(anyInt());
    verify(observer, times(1)).onCompleted();
    verify(observer, never()).onError(any(Throwable.class));
}