### Question:
ClassScanner { public ModuleWithProviders<?> scan(String... packagePrefixes) { ClassGraph classGraph = new ClassGraph().blacklistClasses(excludeClassNames.toArray(new String[excludeClassNames.size()])) .whitelistPackages(packagePrefixes) .enableAnnotationInfo(); try (ScanResult scanResult = classGraph.scan()) { Class<?>[] declarations = Stream.of(Component.class, Directive.class, Pipe.class) .map(Class::getName) .flatMap(c -> scanResult.getClassesWithAnnotation(c) .stream()) .map(ClassInfo::loadClass) .toArray(Class[]::new); Provider[] providers = scanResult.getClassesWithAnnotation(Injectable.class.getName()) .stream() .map(ClassInfo::loadClass) .map(Provider::of) .toArray(Provider[]::new); return ModuleWithProviders.of(Void.class) .declarations(declarations) .providers(providers) .build(); } }  ClassScanner excludeClassNames(String... classNames); ModuleWithProviders<?> scan(String... packagePrefixes);  }### Answer:
@Test public void test() { ClassScanner scanner = new ClassScanner(); ModuleWithProviders<?> mod = scanner.scan(ClassScannerTest.class.getPackage() .getName()); assertThat(mod.getDeclarations()).hasSize(5); assertThat(mod.getDeclarations()).contains(ACmp.class, ADirective.class, XCmp.class, BPipe.class, BCmp.class); assertThat(mod.getProviders()).hasSize(1); assertThat(mod.getProviders() .get(0) .getProvide()).isEqualTo(BService.class); }