ClasspathWorkflowRepository extends AbstractWorkflowRepository implements WorkflowRepository, FileBasedWorkflowRepositoryMXBean { static Set<Class<?>> findWorkflowClasses(final List<String> wfPackages, final ClassLoader cl) throws Exception { final ClassPath cp = ClassPath.from(cl); final Set<Class<?>> set = new HashSet<Class<?>>(); for (String wfPackage : wfPackages) { final ImmutableSet<com.google.common.reflect.ClassPath.ClassInfo> x = cp.getTopLevelClassesRecursive(wfPackage); for (com.google.common.reflect.ClassPath.ClassInfo ci : x) { final Class<?> c = cl.loadClass(ci.getName()); set.add(c); set.addAll(Arrays.asList(c.getDeclaredClasses())); loadAnonymousInnerClasses(cl, set, c); } } return set; } ClasspathWorkflowRepository(final String wfPackage);  ClasspathWorkflowRepository(final List<String> wfPackages); @Override synchronized void start(); @Override synchronized void shutdown(); @Override String getDescription(); @Override List<String> getSourceDirs(); @Override List<String> getSourceArchiveUrls(); @Override String getLastBuildResults();  }
@Test public void testFindWorkflowClasses() throws Exception { assumeTrue(System.getProperty("jdk.module.path", "").isBlank()); Set<Class<?>> set = ClasspathWorkflowRepository.findWorkflowClasses(Collections.singletonList(TESTWORKFLOWS_PACKAGE), Thread.currentThread().getContextClassLoader()); Assert.assertEquals(5, set.size()); Assert.assertNotNull(set.contains(Class.forName("org.copperengine.ext.wfrepo.classpath.testworkflows.TestWorkflowThree"))); }