### Question:
FileUtils { public static String ensureTrailingSeparator(final String path) { Validate.notNull(path); return StringUtils.stripEnd(path, File.separator) + File.separatorChar; } private  FileUtils(); static String backOneDirectory(String fileIdentifier); static boolean copyRecursively(final File source, final File destination,
      final boolean deleteDestinationOnExit); static String ensureTrailingSeparator(final String path); static String getCanonicalPath(final File file); static String getFileSeparatorAsRegex(); static String getFirstDirectory(String fileIdentifier); static InputStream getInputStream(final Class<?> loadingClass, final String filename); static String getPath(final Class<?> loadingClass, final String relativeFilename); static String getSystemDependentPath(final Collection<String> pathElements); static String getSystemDependentPath(final String... pathElements); static boolean matchesAntPath(final String antPattern, final String canonicalPath); static final String CURRENT_DIRECTORY; }### Answer:
@Test public void testEnsureTrailingSeparatorForEmptyPath() { assertEquals(File.separator, FileUtils.ensureTrailingSeparator("")); }
@Test(expected = NullPointerException.class) public void testEnsureTrailingSeparatorForNullPath() { FileUtils.ensureTrailingSeparator(null); }
@Test public void testEnsureTrailingSeparatorForPathWithNoTrailingSeparator() { final String path = "foo"; assertEquals(path + File.separator, FileUtils.ensureTrailingSeparator(path)); }
@Test public void testEnsureTrailingSeparatorForPathWithOneTrailingSeparator() { final String path = "foo" + File.separator; assertEquals(path, FileUtils.ensureTrailingSeparator(path)); }
@Test public void testEnsureTrailingSeparatorFromPathWithMultipleTrailingSeparators() { final String path = "foo" + StringUtils.repeat(File.separator, 3); assertEquals("foo" + File.separator, FileUtils.ensureTrailingSeparator(path)); }