### Question:
FileUtils { public static String getSystemDependentPath(final Collection<String> pathElements) { Validate.notEmpty(pathElements); return StringUtils.join(pathElements, File.separator); } 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 testGetSystemDependentPathFromMultipleElements() { final String expectedPath = "foo" + File.separator + "bar"; assertEquals(expectedPath, FileUtils.getSystemDependentPath("foo", "bar")); }
@Test(expected = IllegalArgumentException.class) public void testGetSystemDependentPathFromNoElements() { FileUtils.getSystemDependentPath(); }
@Test(expected = NullPointerException.class) public void testGetSystemDependentPathFromNullArray() { FileUtils.getSystemDependentPath((String[]) null); }
@Test public void testGetSystemDependentPathFromOneElement() { assertEquals("foo", FileUtils.getSystemDependentPath("foo")); }