DirWalker extends DirectoryWalker implements Runnable { public int getFilesCount() { return files; } protected  DirWalker(List<File> filesAndDirs, FileExclusionManager fileExclusionManager); void run(); void stopWalk(); static DirWalker start(List<File> topDirs, FileExclusionManager fileExclusionManager); boolean walkComplete(); int getFilesCount();  }
@Test public void testDirWalkerWithExclusions() { fileExclusionManager = createMock(FileExclusionManager.class); expect(fileExclusionManager.isExcluded(isA(File.class))).andReturn(true) .times(1); File checkDir = new File("src"); List<File> dirs = new ArrayList<File>(); dirs.add(checkDir); replayAll(); DirWalker dirWalker = createDirWalker(dirs); Collection<File> tempDirFiles = listFiles(checkDir); assertTrue(tempDirFiles.size() > 1); assertEquals(0, ChangedList.getInstance().getListSize()); assertEquals(0, dirWalker.getFilesCount()); }