### Question:
FSUtilities { public static String appendPath(String... paths) { if ((CollectionUtils.isAllNull(Arrays.asList(paths)))) { return null; } StringBuilder buffer = new StringBuilder(); for (String path : paths) { if (path == null || path.isEmpty()) { continue; } boolean emptyBuffer = buffer.length() == 0; boolean bufferEndsWithSlash = !emptyBuffer && "/\\".indexOf(buffer.charAt(buffer.length() - 1)) != -1; boolean pathStartsWithSlash = "/\\".indexOf(path.charAt(0)) != -1; if (!bufferEndsWithSlash && !pathStartsWithSlash && !emptyBuffer) { buffer.append("/"); } else if (pathStartsWithSlash && bufferEndsWithSlash) { path = path.substring(1); } buffer.append(path); } return buffer.toString(); }  static String infoMapToString(Map<String, String> info); static String getSafeFilename(String untrustedFilename); static String escapeEncode(String s); static String escapeDecode(String s); static List<GFile> listFileSystem(GFileSystem fs, GFile dir, List<GFile> result,
			TaskMonitor taskMonitor); static String getFilesystemTypeFromClass(Class<?> clazz); static String getFilesystemDescriptionFromClass(Class<?> clazz); static int getFilesystemPriorityFromClass(Class<?> clazz); static boolean isSameFS(List<FSRL> fsrls); static void displayException(Object originator, Component parent, String title,
			String message, Throwable throwable); @SuppressWarnings("resource") static StreamCopyResult streamCopy(InputStream is, OutputStream os, TaskMonitor monitor); static String getStreamMD5(InputStream is, TaskMonitor monitor); static String getFileMD5(File f, TaskMonitor monitor); static String appendPath(String... paths); static String getExtension(String path, int extLevel); static String normalizeNativePath(String path); static final String SEPARATOR_CHARS; static final String SEPARATOR; static final Comparator<GFile> GFILE_NAME_TYPE_COMPARATOR; }### Answer:
@Test public void testAppendPath() { assertNull(FSUtilities.appendPath()); assertNull(FSUtilities.appendPath(null, null)); assertNull(FSUtilities.appendPath(null, null, null)); assertEquals("", FSUtilities.appendPath("", "")); assertEquals("", FSUtilities.appendPath("")); assertEquals("", FSUtilities.appendPath("", "", "")); assertEquals(" ", FSUtilities.appendPath(" ")); assertEquals(" /\t", FSUtilities.appendPath(" ", "\t")); assertEquals("/", FSUtilities.appendPath("/", "")); assertEquals("/", FSUtilities.appendPath("/", null)); assertEquals("/", FSUtilities.appendPath("/", null, "")); assertEquals("/", FSUtilities.appendPath("/", null, null)); assertEquals("/", FSUtilities.appendPath("", null, "/")); assertEquals("blah", FSUtilities.appendPath("", "blah")); assertEquals("/blah", FSUtilities.appendPath("", null, "/blah")); assertEquals("blah", FSUtilities.appendPath("", null, "blah")); assertEquals("/blah/leading", FSUtilities.appendPath("/blah/", "/leading")); assertEquals("/blah/leading/dir", FSUtilities.appendPath("/blah/", "/leading", "dir")); assertEquals("blah", FSUtilities.appendPath("blah")); assertEquals("blah/sub", FSUtilities.appendPath("blah", "sub")); assertEquals("blah/sub", FSUtilities.appendPath("blah/", "sub")); assertEquals("blah\\sub", FSUtilities.appendPath("blah\\", "sub")); assertEquals("blah/sub", FSUtilities.appendPath("blah", "/sub")); assertEquals("blah\\sub", FSUtilities.appendPath("blah", "\\sub")); assertEquals("/blah/blah\\sub", FSUtilities.appendPath("/blah/blah", "\\sub")); assertEquals("\\blah\\blah\\sub", FSUtilities.appendPath("\\blah\\blah", "\\sub")); assertEquals("\\blah\\blah\\sub", FSUtilities.appendPath("\\blah\\blah\\", "\\sub")); }
@Test public void testAppendPath_MultipleSeparators() { assertEquals("/blah assertEquals("/blah assertEquals(" assertEquals("\\\\\\", FSUtilities.appendPath("\\\\", "\\\\")); }