MakeDirectoryOperation { public void compute(File rootDirectory, String name) { cancelPreviousOperation(); Observable<File> observable = new MakeDirectoryObservable().create(rootDirectory, name); DisposableObserver<File> observer = new MakeDirectoryObserver(dataSet, bus); disposables.add(observable.subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribeWith(observer)); } MakeDirectoryOperation(DirectoryTree dataSet, EventBus bus); void compute(File rootDirectory, String name); void cancelPreviousOperation();  }
@Test public void shouldCreateNewDisposable() throws Exception { sut.compute(mock(File.class), ""); assertEquals(1, sut.disposables.size()); }