### Question:
ClassPathScannerImpl implements ClassPathScanner { @Override public Set<Class< ? >> getTypesAnnotatedWith( final Class< ? extends Annotation> annotation) { final Predicate<String> packageFilter = new FilterBuilder().include(FilterBuilder.prefix(packageName)); final Predicate<String> annotationFilter = new FilterBuilder().include(annotation.getCanonicalName()); final Scanner annotationScanner = new TypeAnnotationsScanner().filterResultsBy(annotationFilter); final ConfigurationBuilder builder = new ConfigurationBuilder() .setUrls(ClasspathHelper.forPackage(packageName, ClasspathHelper.classLoaders())) .filterInputsBy(packageFilter) .setScanners(annotationScanner); final Reflections reflections = new Reflections(builder); return reflections.getTypesAnnotatedWith(annotation); } ClassPathScannerImpl(final String packageName); @Override Set<Class< ? >> getTypesAnnotatedWith(
            final Class< ? extends Annotation> annotation);  }### Answer:
@Test public void scanAnnotatedTypes() { final Set<Class< ? >> results = scanner .getTypesAnnotatedWith(MyAnnotation.class); assertNotNull("Null set of results", results); assertEquals("One element expected", 1, results.size()); assertEquals("Unexpected element", AnnotatedClass.class, results .iterator().next()); }
@Test public void scanAnnotatedTypesAtUnknownPackage() { final Set<Class< ? >> results = new ClassPathScannerImpl( "not.existing.package") .getTypesAnnotatedWith(MyAnnotation.class); assertNotNull("Null set of results", results); assertTrue("Empty set expected", results.isEmpty()); }