ClassUtils { @Nullable public static String findClassPath(Class<?> type) { return findClassPath(type.getName()); } private  ClassUtils(); @Nonnull static Set<String> getAllPackageNamesInClassPaths(); @Nullable static String resolvePackageName(String className); @Nonnull static Set<String> findClassNamesInClassPath(String classPath, boolean recursive); @Nullable static String findClassPath(Class<?> type); @Nullable static String findClassPath(String className); @Nonnull static Set<String> getClassNamesInClassPath(String classPath, boolean recursive); @Nonnull static Set<String> getClassNamesInPackage(Package onePackage); @Nonnull static Set<String> getClassNamesInPackage(String packageName); static String resolveClassName(String resourceName); @Nonnull static Map<String, Set<String>> getClassPathToClassNamesMap(); @Nonnull static Set<String> getAllClassNamesInClassPaths(); static URL getCodeSourceLocation(Class<?> type);  }
@Test public void testFindClassPath() { String classPath = ClassUtils.findClassPath(MapUtils.class); Assert.assertNotNull(classPath); classPath = ClassUtils.findClassPath(String.class); Assert.assertNotNull(classPath); }