ListDirectoryObserver extends DisposableObserver<File> { @Override public void onNext(File file) { dataSet.directoryList.add(file); } ListDirectoryObserver(DirectoryTree dataSet, EventBus bus); @Override void onComplete(); @Override void onError(Throwable e); @Override void onNext(File file);  }
@Test public void onNextShouldUpdateDirectoryTree() throws Exception { File mockFile1 = mock(File.class); File mockFile2 = mock(File.class); File mockFile3 = mock(File.class); sut.onNext(mockFile1); sut.onNext(mockFile2); sut.onNext(mockFile3); assertTrue(directoryTree.directoryList.contains(mockFile1)); assertTrue(directoryTree.directoryList.contains(mockFile2)); assertTrue(directoryTree.directoryList.contains(mockFile3)); }