### Question:
StaticFileUtils { public static String rebaseSplitPath(String srcBase, String srcPath, String dstBase) throws FileUtilsException { String[] srcBaseArr = splitPath(srcBase); String[] srcPathArr = splitPath(srcPath); String[] dstBaseArr = splitPath(dstBase); String[] rebasedPath = rebaseSplitPath(srcBaseArr, srcPathArr, dstBaseArr); String rebasePathString = splitPathToString(rebasedPath); return rebasePathString; }  static synchronized String generateRandomBase(); static String expandUser(String pathIn); static DataOutputStream openDataOutputStreamFile(String fileName); static DataInputStream openDataInputStreamFile(String fileName); static DataOutputStream openDataOutputStreamFile(String fileName, int buffsize); static DataInputStream openDataInputStreamFile(String fileName, int buffsize); static byte[] readFile(File file); static byte[] readFile(String fileName); static void copyStreams(InputStream is, OutputStream os, PrintStream ps, long isSize, int buffsize); static void copyStreams(InputStream is, OutputStream os, PrintStream ps, int buffsize); static OutputStream openOutputFile(String fileName); static OutputStream openOutputFile(String fileName, int buffsize); static InputStream openInputFile(String fileName); static InputStream openInputFile(String fileName, int buffsize); static String getWorkingDirectory(); static List<String> joinPath(List<String> paths); static List<String> splitPathList(String pathName); static String[] splitPath(String pathName); static String joinPath(String firstPart, String secondPart); static String[] joinPath(String[] firstPart, String[] secondPart); static String splitPathToString(List<String> pathComps); static String splitPathToString(String[] splitPath); static String rebaseSplitPath(String srcBase, String srcPath, String dstBase); static String[] rebaseSplitPath(String[] srcBase, String[] srcPath, String[] dstBase); static String[] stripBeginingPath(String[] splitPath, int nTimes); static String directoryNameFromFullPath(String fullFilePath); static String stripDirectoryFromFileName(String fullFilePath); static String pathTail(String path); static String[] stripEndPath(String[] splitPath, int nTimes); static List<String> listDir(String filePath); static byte[] readInputStream(InputStream fis, int buffSize); static byte[] readInputStream(InputStream fis); static long computeCrc(InputStream fis); static void mkParentDir(String filePath); static Properties loadProperties(String propertiesPath); static String sanitizeDir(String dir); static Map<String, List> getLocalCachedFiles(String cacheLocation); static String getLogFileTime(String absoluteFileName); static void deleteLocalFile(String fileName); static void deleteFilesOlderThanNDays(String location, int nDays); static void delete(String location, long purgeTime); static Date getDateFromFileName(String fileName); static String getDateStringFromFileName(String fileName); static String getNewestFile(List<String> fileNames); static String getTotalTimeTaken(String dateStart); static Date getDate(String dateString, DateFormat format); static String getMonthYearFromFileDate(String dateString); static BufferedReader inputStreamToBufferedReader(InputStream is); static Random getRnd(); static boolean isSymLink(String filePath); static void close(Closeable stream); static BufferedReader inputStreamToBufferedReader(InputStream is, int buffSize); static String mergePathString(String... pathArray); static RandomAccessFile openRandomReadFile(String filePath); static long fileSize(String filePath); static void drainInputStream(InputStream is); static DateFormat filedf; static DateFormat jobdf; }### Answer:
@Test public void testRebasePath() throws FileUtilsException { assertTrue(StaticFileUtils.rebaseSplitPath("/users/hdfs/output/l", "/users/hdfs/output/l/logs/test/test.zip", "/nfs/mnt").equals("/nfs/mnt/logs/test/test.zip")); assertTrue(StaticFileUtils.rebaseSplitPath("/users/hdfs/output/l", "/users/hdfs/output/l/logs/test/someOtherDirectory/test.zip", "/user/local/mnt").equals("/user/local/mnt/logs/test/someOtherDirectory/test.zip")); }