ClassLoaderUtils { @Deprecated public static File findClassPathOfClass(Class<?> cl) { return BasicFileUtils.toCanonicalFile(extractPathFromURL(findUrlClassPathOfClass(cl))); } private  ClassLoaderUtils(); @Deprecated static File findClassPathOfClass(Class<?> cl); static URL findUrlClassPathOfClass(Class<?> cl); static URL extractFileUrlFromUrl(URL url); @Deprecated static File extractPathFromURL(URL url); static URL getUrlOfClassPath(); @Deprecated static File getLocationOfClassPath(); static ClassLoader classLoaderFromClassPathUrls(Collection<URL> classPath, ClassLoader parent); @Deprecated static ClassLoader classLoaderFromClassPath(Collection<File> classPath, ClassLoader parent);  }
@Test public void testFindClassPathOfClassForJar() { File jarOfJUnit = ClassLoaderUtils.findClassPathOfClass(org.junit.Assert.class); assertTrue("Jar must exist: " + jarOfJUnit, jarOfJUnit.isFile()); assertTrue("Must have extension jar: " + jarOfJUnit, jarOfJUnit.getName().endsWith(".jar")); }