/** * Attempts to discover classes that are annotated with to the annotation. Accumulated * classes can be accessed by calling {@link #getClasses()}. * * @param annotation the annotation that should be present on matching classes * @param packageNames one or more package names to scan (including subpackages) for classes */ public void findAnnotated(Class<? extends Annotation> annotation, String... packageNames) { if (packageNames == null) return; Test test = new AnnotatedWith(annotation); for (String pkg : packageNames) { findInPackage(test, pkg); } }