Rx { public static void dispose(Disposable disposable) { if (disposable != null && !disposable.isDisposed()) { disposable.dispose(); } } private  Rx(Scheduler io, Scheduler ui, Scheduler newThread); static void dispose(Disposable disposable); static void onError(Throwable throwable); static Rx test(); FlowableTransformer<T, T> flowableSchedulers(); SingleTransformer<T, T> singleSchedulers(); Scheduler io(); Scheduler newThread();  }
@Test public void dispose() { CompositeDisposable disposable = new CompositeDisposable(); assertThat(disposable.isDisposed(), is(false)); Rx.dispose(disposable); assertThat(disposable.isDisposed(), is(true)); }
@Test public void disposeNull() { Rx.dispose(null); }
@Test public void disposeAlreadyDisposed() { CompositeDisposable disposable = new CompositeDisposable(); disposable.dispose(); assertThat(disposable.isDisposed(), is(true)); Rx.dispose(disposable); assertThat(disposable.isDisposed(), is(true)); }