ResourceSubscriber implements FlowableSubscriber<T>, Disposable { @Override public final boolean isDisposed() { return SubscriptionHelper.isCancelled(s.get()); }  final void add(Disposable resource); @Override final void onSubscribe(Subscription s); @Override final void dispose(); @Override final boolean isDisposed();  }
@Test public void normal() { TestResourceSubscriber<Integer> tc = new TestResourceSubscriber<Integer>(); assertFalse(tc.isDisposed()); assertEquals(0, tc.start); assertTrue(tc.values.isEmpty()); assertTrue(tc.errors.isEmpty()); Flowable.just(1).subscribe(tc); assertTrue(tc.isDisposed()); assertEquals(1, tc.start); assertEquals(1, tc.values.get(0).intValue()); assertTrue(tc.errors.isEmpty()); }