### Question:
ClassPathUtil { public static LinkedList<File> getClassPath() { LinkedList<File> classpath = new LinkedList<File>(); ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); getClassPathFromClassLoader(classpath, classLoader); return classpath; }  static void appendClasspath(StringBuilder builder,
			List<File> classpath); static LinkedList<File> getClassPath(); static void dumpStats();  }### 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); LinkedList<File> classpath = ClassPathUtil.getClassPath(); Assert.assertThat(classpath, hasItem(jarA)); Assert.assertThat(classpath, hasItem(jarB)); Assert.assertThat(classpath, hasItem(jarC)); } finally { Thread.currentThread().setContextClassLoader(original); } }
@Test public void testFindSoaClient() throws Exception { testingdir.ensureEmpty(); ClassLoader original = Thread.currentThread().getContextClassLoader(); URLClassLoader ucl = new URLClassLoader(new URL[0], original); try { Thread.currentThread().setContextClassLoader(ucl); LinkedList<File> classpath = ClassPathUtil.getClassPath(); String expected = File.separator + "soa-client"; boolean found = false; for (File file : classpath) { System.out.println("Class-Path Entry:: " + file.getAbsolutePath()); if (file.getAbsolutePath().contains(expected)) { found = true; } } Assert.assertTrue("Should have found soa-client within classpath", found); } finally { Thread.currentThread().setContextClassLoader(original); } }