BlockingMultiObserver extends CountDownLatch implements SingleObserver<T>, CompletableObserver, MaybeObserver<T> { void dispose() { cancelled = true; Disposable d = this.d; if (d != null) { d.dispose(); } } BlockingMultiObserver(); @Override void onSubscribe(Disposable d); @Override void onSuccess(T value); @Override void onError(Throwable e); @Override void onComplete(); T blockingGet(); T blockingGet(T defaultValue); Throwable blockingGetError(); Throwable blockingGetError(long timeout, TimeUnit unit); boolean blockingAwait(long timeout, TimeUnit unit);  }
@Test public void dispose() { BlockingMultiObserver<Integer> bmo = new BlockingMultiObserver<Integer>(); bmo.dispose(); Disposable d = Disposables.empty(); bmo.onSubscribe(d); }