### Question:
JavacHelper { public static String buildClasspath(String classpathPrefix) { LinkedList<File> classpath = ClassPathUtil.getClassPath(); StringBuilder cp = new StringBuilder(); if (!CodeGenUtil.isEmptyString(classpathPrefix)) { cp.append(classpathPrefix); cp.append(File.pathSeparator); } if(classpath.isEmpty()) { cp.append(System.getProperty("java.class.path")); return cp.toString(); } ClassPathUtil.appendClasspath(cp, classpath); if(LOG.isLoggable(Level.FINER)) { StringBuilder b = new StringBuilder(); b.append("Classpath:"); String ln = System.getProperty("line.separator"); for(File path: classpath) { b.append(ln).append(path.getAbsolutePath()); } LOG.finer(b.toString()); } return cp.toString(); } JavacHelper(OutputStream out); void oldCompileJavaSource(List<String> javaSrcFiles, String outputDir); void compileJavaSource(List<String> javaSrcFiles, String outputDir); void oldCompileJavaSource(String javaSources, String srcDir,
			String outputDir); void compileJavaSource(String javaSources, String srcDir,
			String outputDir); static String buildClasspath(String classpathPrefix); static boolean addToClasspath(String classpathEntry); static String normalizeURLPath(URI uri);  }### Answer:
@Test public void testCyclicManifest() throws Exception { testingdir.ensureEmpty(); File jarA = TestResourceUtil.copyResource("cyclic-manifest-classpath/a.jar", testingdir, "lib"); File jarB = TestResourceUtil.copyResource("cyclic-manifest-classpath/b.jar", testingdir, "lib"); File jarC = TestResourceUtil.copyResource("cyclic-manifest-classpath/c.jar", testingdir, "lib"); URL urls[] = { jarA.toURI().toURL() }; ClassLoader original = Thread.currentThread().getContextClassLoader(); URLClassLoader ucl = new URLClassLoader(urls, original); try { Thread.currentThread().setContextClassLoader(ucl); String classpath = JavacHelper.buildClasspath(testingdir.getDir().getAbsolutePath()); Assert.assertThat(classpath, containsString(jarA.getAbsolutePath())); Assert.assertThat(classpath, containsString(jarB.getAbsolutePath())); Assert.assertThat(classpath, containsString(jarC.getAbsolutePath())); } finally { Thread.currentThread().setContextClassLoader(original); } }