JavaLibrary { public static String[] asFilePath(URL[] urls) { int length = urls.length; String[] filePath = new String[length]; for (int i = 0; i < length; i += 1) { filePath[i] = urls[i].getFile(); } return filePath; }  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 filePathFromClasspath() throws MalformedURLException { URL url = new URL("file: URL url2 = new URL("file: URL[] classpath = new URL[] {url, url2}; String[] filePath = asFilePath(classpath); assertTrue(2 == filePath.length); assertEquals("/imaginary/project/folder/src", filePath[0]); assertEquals("/imaginary/dependency/lib.jar", filePath[1]); }