ClasspathScanUtil { public static Optional<Set<Class<?>>> readClassSet(String resourceName, ClassLoader classLoader) { return readClasses( resourceName, classLoader, ClasspathScanUtil::readClassSet ); }  static Optional<Set<Class<?>>> readClassSet(String resourceName, ClassLoader classLoader); static Optional<Map<Class<? extends Annotation>, Set<Class<?>>>> readClassMap(String resourceName, ClassLoader classLoader);  }
@Test void readClassSet() { Optional<Set<Class<?>>> classes = ClasspathScanUtil.readClassSet("META-INF/joinfaces/test-list.classes", getClass().getClassLoader()); assertThat(classes).isPresent(); assertThat(classes.get()).contains(String.class, FacesContext.class); }
@Test void readAnnotationClassSet() { String sb = Test.class.getName() + "\n" + ClasspathScanUtil.class.getName() + "\n" + ClasspathScanUtilTest.class.getName() + "\n"; BufferedReader in = new BufferedReader(new StringReader(sb)); Set<Class<?>> set = ClasspathScanUtil.readClassSet(in, this.getClass().getClassLoader()); assertThat(set).contains(Test.class, ClasspathScanUtil.class, ClasspathScanUtilTest.class); }