@Test
public void cancel() {

    BooleanSubscription bs = new BooleanSubscription();
    Disposable d = Disposables.empty();
    s.setResource(d);
    s.onSubscribe(bs);
    assertFalse(d.isDisposed());
    assertFalse(s.isDisposed());
    ts.cancel();
    assertTrue(bs.isCancelled());
    assertTrue(d.isDisposed());
    assertTrue(s.isDisposed());
}