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