@Test
public void testDelaySubscriptionCancelBeforeTime() {

    TestScheduler scheduler = new TestScheduler();
    Observable<Integer> result = Observable.from(1, 2, 3).delaySubscription(100, TimeUnit.MILLISECONDS, scheduler);
    Observer<Object> o = mock(Observer.class);
    Subscription s = result.subscribe(o);
    s.unsubscribe();
    scheduler.advanceTimeBy(100, TimeUnit.MILLISECONDS);
    verify(o, never()).onNext(any());
    verify(o, never()).onCompleted();
    verify(o, never()).onError(any(Throwable.class));
}