FileUtils { public static String ensureLeadingSlash(final String path) { return path.startsWith("/") ? path : "/" + path; }  static void mkdirs(final File f); static void deleteDirectory(final File directory); static String getDelta(File parent, File child); static String getRelativePath(String targetPath, String basePath, String pathSeparator); static boolean isSymbolicLink(File file); static void createSymbolicLink(final File source, final File target); static boolean isChild(File parent, File child); static String ensureLeadingSlash(final String path); static String getAppendix(final File f);  }
@Test public void testAddLeadingSlash() { assertEquals("/abc/def", FileUtils.ensureLeadingSlash("abc/def")); }
@Test public void testNoDoubleLeadingSlash() { assertEquals("/abc/def", FileUtils.ensureLeadingSlash("/abc/def")); }
@Test(expected = NullPointerException.class) public void testNullPointer() { FileUtils.ensureLeadingSlash(null); }