### Question:
FileMatcher { private static FileMatcher createMatcher(String basedir, Collection<String> includes, Matcher excludesMatcher) { final Matcher includesMatcher = fromStrings(basedir, includes, null); return new FileMatcher(toDirectoryPath(basedir), includesMatcher, excludesMatcher); } private  FileMatcher(String basedir, Matcher includesMatcher, Matcher excludesMatcher); boolean matches(String path); boolean matches(Path file); boolean matches(File file); static Map<Path, FileMatcher> createMatchers(final Path basedir,
      Collection<String> includes, Collection<String> excludes); static Map<String, FileMatcher> createMatchers(Collection<String> includes,
      Collection<String> excludes); static FileMatcher createMatcher(final Path basedir, Collection<String> includes,
      Collection<String> excludes); static FileMatcher createMatcher(Collection<String> includes,
      Collection<String> excludes);  }### Answer:
@Test public void testSingleDirectoryMatch() throws Exception { File basedir = temp.newFolder().getCanonicalFile(); createDirectories(basedir, "sub"); createFiles(basedir, "1.txt", "sub/2.txt", "sub/3.txt"); List<String> includes = new ArrayList<>(); includes.add("*.txt"); FileMatcher matcher = FileMatcher.createMatcher(basedir.toPath(), includes, null); assertFiles(getMatchingFiles(matcher, basedir), new File(basedir, "1.txt")); }
@Test public void testNestedDirectoryMatch() throws Exception { File basedir = temp.newFolder().getCanonicalFile(); createDirectories(basedir, "sub", "sub2", "sub/sub"); createFiles(basedir, "1.txt", "sub/2.txt", "sub2/3.txt", "sub/sub/4.txt", "sub/sub/5.txt"); List<String> includes = new ArrayList<>(); includes.add("**/*.txt"); FileMatcher matcher = FileMatcher.createMatcher(basedir.toPath(), includes, null); assertFiles(getMatchingFiles(matcher, basedir), new File(basedir, "1.txt"), new File(basedir, "sub/2.txt"), new File(basedir, "sub2/3.txt"), new File(basedir, "sub/sub/4.txt"), new File(basedir, "sub/sub/5.txt")); }