### Question:
PathNormalizer { boolean isBasedirOrNestedFile(String file) { if (basedir != null && file.startsWith(basedir)) { int baseLength = basedir.length(); if (baseLength == file.length()) { return true; } char charL = file.charAt(baseLength); return charL == SEPARATOR_CHAR || charL == File.separatorChar; } return false; } private  PathNormalizer(String basedir); static PathNormalizer createNormalizer(Path basedir); static PathNormalizer createNormalizer(String memento); static PathNormalizer createNormalizer(); String getMemento(); String normalize(String file); String normalize(Path path); static String normalize0(Path file); static Path getCanonicalPath(Path file); static String normalize0(String file); static Path toPath(String file);  }### Answer:
@Test public void testIsBasedirOrNestedFile() throws Exception { Path basedir = temp.newFolder().getCanonicalFile().toPath(); PathNormalizer testee = PathNormalizer.createNormalizer(basedir); assertTrue(testee.isBasedirOrNestedFile(basedir.toString())); assertTrue(testee.isBasedirOrNestedFile(basedir.resolve("nested").toString())); assertFalse(testee.isBasedirOrNestedFile(temp.getRoot().getCanonicalPath())); String basepath = basedir.toString(); assertFalse(basepath.endsWith(File.separator)); assertFalse(testee.isBasedirOrNestedFile(basepath + "sibling")); }