### Question:
ImportBatchTask extends Task { static String fsrlToPath(FSRL fsrl, FSRL userSrc, boolean stripLeadingPath, boolean stripInteriorContainerPath) { String fullPath = fsrl.toPrettyFullpathString().replace('|', '/'); String userSrcPath = userSrc.toPrettyFullpathString().replace('|', '/'); int filename = fullPath.lastIndexOf('/') + 1; int uas = userSrcPath.length(); int container = uas + 1; int leadStart = (stripLeadingPath == false) ? 0 : userSrcPath.lastIndexOf('/') + 1; int leadEnd = Math.min(filename, userSrcPath.length()); String leading = (leadStart < filename) ? fullPath.substring(leadStart, leadEnd) : ""; String containerPath = container < filename && !stripInteriorContainerPath ? fullPath.substring(container, filename) : ""; String filenameStr = fullPath.substring(filename); String result = FSUtilities.appendPath(leading, containerPath, filenameStr); return result; } ImportBatchTask(BatchInfo batchInfo, DomainFolder destFolder,
			ProgramManager programManager, boolean stripLeading, boolean stripAllContainerPath); @Override void run(TaskMonitor monitor); static final int MAX_PROGRAMS_TO_OPEN; }### Answer:
@Test public void testNoNested() throws MalformedURLException { FSRL fsrl = FSRL.fromString("fsrl: Assert.assertEquals("/a/b", ImportBatchTask.fsrlToPath(fsrl, fsrl, false, false)); }
@Test public void testNoNested_StripLeading() throws MalformedURLException { FSRL fsrl = FSRL.fromString("fsrl: Assert.assertEquals("b", ImportBatchTask.fsrlToPath(fsrl, fsrl, true, false)); }
@Test public void testNestedSingleLvl() throws MalformedURLException { FSRL src = FSRL.fromString("fsrl: FSRL fsrl = FSRL.fromString("fsrl: Assert.assertEquals("/a/b", ImportBatchTask.fsrlToPath(fsrl, src, false, false)); Assert.assertEquals("a/b", ImportBatchTask.fsrlToPath(fsrl, src, true, false)); }
@Test public void testNestedDeeper() throws MalformedURLException { FSRL src_bfile = FSRL.fromString("fsrl: FSRL target_efile = FSRL.fromString("fsrl: Assert.assertEquals("/a/b/c/d/e", ImportBatchTask.fsrlToPath(target_efile, src_bfile, false, false)); Assert.assertEquals("b/c/d/e", ImportBatchTask.fsrlToPath(target_efile, src_bfile, true, false)); Assert.assertEquals("/a/b/e", ImportBatchTask.fsrlToPath(target_efile, src_bfile, false, true)); Assert.assertEquals("b/e", ImportBatchTask.fsrlToPath(target_efile, src_bfile, true, true)); }