@Test
public void testFilterSubpaths() {

  final Path p1 = Paths.get("./src/test/resources/foo/bar/empty.txt");
  final Path p2 = Paths.get("./src/test/resources/foo/bar");
  final Path p3 = Paths.get("./src/test/resources/foo");
  final Path p4 = Paths.get("./src/test/resources/foo/empty");
  final Set<Path> filter = new HashSet<Path>();
  filter.add(p2);
  final Set<Path> to_be_filtered = new HashSet<Path>();
  to_be_filtered.add(p1);
  to_be_filtered.add(p3);
  to_be_filtered.add(p4);
  final Set<Path> r1 = DirUtil.filterSubpaths(to_be_filtered, filter, true);
  assertEquals(1, r1.size());
  final Set<Path> r2 = DirUtil.filterSubpaths(to_be_filtered, filter, false);
  assertEquals(2, r2.size());
}