### Question:
IncludeExcludePathMatcher implements PathMatcher { @Override public boolean matches(Path path) { return included.matches(path) && !excluded.matches(path); } IncludeExcludePathMatcher(FileSystem fileSystem, String includedPattern, String excludedPattern); @Override boolean matches(Path path); @Override String toString();  }### Answer:
@Test public void matches_included_patterns() { IncludeExcludePathMatcher matcher = new IncludeExcludePathMatcher(FileSystems.getDefault(), "glob:*.txt", ""); assertThat(matcher, matches(Paths.get("foo.txt"))); assertThat(matcher, not(matches(Paths.get("foo.html")))); }
@Test public void does_not_match_included_but_also_excluded_patterns() { IncludeExcludePathMatcher matcher = new IncludeExcludePathMatcher(FileSystems.getDefault(), "glob:*.txt", "glob:bar*"); assertThat(matcher, matches(Paths.get("foo.txt"))); assertThat(matcher, not(matches(Paths.get("bar.txt")))); }