DisposableSubscriber implements FlowableSubscriber<T>, Disposable { @Override public final void dispose() { SubscriptionHelper.cancel(s); }  @Override final void onSubscribe(Subscription s); @Override final boolean isDisposed(); @Override final void dispose();  }
@Test public void dispose() { TestDisposableSubscriber<Integer> tc = new TestDisposableSubscriber<Integer>(); assertFalse(tc.isDisposed()); tc.dispose(); assertTrue(tc.isDisposed()); BooleanSubscription d = new BooleanSubscription(); tc.onSubscribe(d); assertTrue(d.isCancelled()); assertEquals(0, tc.start); }