JavaLibrary { public static String asClasspath(URL[] urls) { List<String> paths = new LinkedList<String>(); for (URL url : urls) { paths.add(url.getPath()); } return StringLibrary.join(paths, classpathSeparator()); }  static String asClasspath(URL[] urls); static String[] asFilePath(URL[] urls); static String simpleClassName(String qualifiedClassName); static String packageName(String qualifiedClassName); static String systemClasspath(); static URL[] systemClasspathURLs(); static void extendSystemClasspathWith(URL[] classpaths); static URL[] extendClasspathWith(String classpath, URL[] destination); static URL[] classpathFrom(String classpath); static void setClasspath(String newClasspath); static void extendSystemClassLoaderClasspathWith(URL[] classpaths); static void extendClassLoaderClasspathWith(URLClassLoader classLoader, URL[] classpaths); static Class<?> classFromClasspath(URL classpath, String qualifiedName); static List<Class<?>> classesFromClasspath(URL[] classpath, Collection<String> qualifiedNames); static List<Class<?>> loadedClassesFrom(ClassLoader classLoader, Collection<String> qualifiedNames); static void close(URLClassLoader loader); static Character classpathSeparator(); static Character folderPathSeparator(); static String lineSeparator();  }
@Test public void joinClasspaths() throws MalformedURLException { URL url = new URL("file: URL url2 = new URL("file: String classpath = asClasspath(new URL[] {url, url2}); Character classPathSeparator = File.pathSeparatorChar; assertEquals("/imaginary/project/folder/src" + classPathSeparator + "/imaginary/dependency/lib.jar", classpath); }