ClassUtils { @Nonnull public static Set<String> getClassNamesInClassPath(String classPath, boolean recursive) { Set<String> classNames = classPathToClassNamesMap.get(classPath); if (CollectionUtils.isEmpty(classNames)) { classNames = findClassNamesInClassPath(classPath, recursive); } return classNames; } 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 testGetClassNamesInClassPath() { Set<String> classPaths = ClassPathUtils.getClassPaths(); for (String classPath : classPaths) { Set<String> classNames = ClassUtils.getClassNamesInClassPath(classPath, true); Assert.assertNotNull(classNames); } }