@Test
public void debounceSelectorNormal1() {

    PublishSubject<Integer> source = PublishSubject.create();
    final PublishSubject<Integer> debouncer = PublishSubject.create();
    Func1<Integer, Observable<Integer>> debounceSel = new Func1<Integer, Observable<Integer>>() {
        @Override
        public Observable<Integer> call(Integer t1) {
            return debouncer;
        }
    };
    @SuppressWarnings("unchecked")
    Observer<Object> o = mock(Observer.class);
    InOrder inOrder = inOrder(o);
    source.debounce(debounceSel).subscribe(o);
    source.onNext(1);
    debouncer.onNext(1);
    source.onNext(2);
    source.onNext(3);
    source.onNext(4);
    debouncer.onNext(2);
    source.onNext(5);
    source.onCompleted();
    inOrder.verify(o).onNext(1);
    inOrder.verify(o).onNext(4);
    inOrder.verify(o).onNext(5);
    inOrder.verify(o).onCompleted();
    verify(o, never()).onError(any(Throwable.class));
}