@Test
public void testDebounceNeverEmits() {

    Observable<String> source = Observable.create(new Observable.OnSubscribeFunc<String>() {
        @Override
        public Subscription onSubscribe(Observer<? super String> observer) {
            // all should be skipped since they are happening faster than the 200ms timeout
            publishNext(observer, 100, "a");    // Should be skipped
            publishNext(observer, 200, "b");    // Should be skipped
            publishNext(observer, 300, "c");    // Should be skipped
            publishNext(observer, 400, "d");    // Should be skipped
            publishNext(observer, 500, "e");    // Should be skipped
            publishNext(observer, 600, "f");    // Should be skipped
            publishNext(observer, 700, "g");    // Should be skipped
            publishNext(observer, 800, "h");    // Should be skipped
            publishCompleted(observer, 900);     // Should be published as soon as the timeout expires.
            return Subscriptions.empty();
        }
    });
    Observable<String> sampled = Observable.create(OperationDebounce.debounce(source, 200, TimeUnit.MILLISECONDS, scheduler));
    sampled.subscribe(observer);
    scheduler.advanceTimeTo(0, TimeUnit.MILLISECONDS);
    InOrder inOrder = inOrder(observer);
    inOrder.verify(observer, times(0)).onNext(anyString());
    scheduler.advanceTimeTo(1000, TimeUnit.MILLISECONDS);
    inOrder.verify(observer, times(1)).onCompleted();
    inOrder.verifyNoMoreInteractions();
}