### Question:
HelpBuildUtils { public static Path relativizeWithHelpTopics(Path p) { if (p == null) { return null; } Path helpTopics = p.getFileSystem().getPath("help", "topics"); return relativize(helpTopics, p); } private  HelpBuildUtils(); static HelpModuleLocation toLocation(File file); static Path getRoot(Collection<Path> roots, Path file); static Path getHelpTopicDir(Path file); static Path getFile(Path srcFile, String relativePath); static Path relativizeWithHelpTopics(Path p); static Path relativize(Path parent, Path child); static void cleanupHelpFileLinks(Path helpFile); static void debug(String text); static Path toDefaultFS(Path path); static Path toFS(Path targetFS, Path path); static Path createReferencePath(URI fileURI); static boolean isRemote(String uriString); static boolean isRemote(Path path); static boolean isRemote(URI uri); static ImageLocation locateImageReference(Path sourceFile, String ref); static Path locateReference(Path sourceFile, String ref); static boolean debug; }### Answer:
@Test public void testGetRelativeHelpPath() { String relativeString = "help/topics/FooTopic/FooFile.html"; Path path = Paths.get("/some/fake/path/to/" + relativeString); Path relative = HelpBuildUtils.relativizeWithHelpTopics(path); assertEquals(relativeString, relative.toString()); }
@Test public void testGetRelativeHelpPath_NoHelpTopicInPath() { String invalidRelativeString = "help/topicz/" + TOPIC_AND_FILENAME; Path path = Paths.get("/some/fake/path/to/" + invalidRelativeString); Path relative = HelpBuildUtils.relativizeWithHelpTopics(path); assertNull(relative); }