fileTree.visit(visitor);
}
@Test
public void canTestForFileMembership() {
TestFile rootDir = tmpDir.createDir("root");
TestFile rootTextFile = rootDir.file("a.txt").createFile();
TestFile nestedTextFile = rootDir.file("a/b/c.txt").createFile();
TestFile notTextFile = rootDir.file("a/b/c.html").createFile();
TestFile excludedFile = rootDir.file("subdir1/a/b/c.html").createFile();
TestFile notUnderRoot = tmpDir.createDir("root2").file("a.txt").createFile();
TestFile doesNotExist = rootDir.file("b.txt");
PatternSet patterns = new PatternSet();
patterns.include("**/*.txt");
patterns.exclude("subdir1/**");
DirectoryFileTree fileTree = new DirectoryFileTree(rootDir, patterns);