CachedAnnotationScanner { public static Set<Method> getMethodsWithAnnotation(Class<? extends Annotation> annotationClass) { return getMethodsWithAnnotation(annotationClass, Thread.currentThread().getContextClassLoader()); }  static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation> annotationClass); static Set<Class<?>> getClassesWithAnnotation(Class<? extends Annotation> annotationClass,
			ClassLoader classloader); static Set<Class<?>> getClassesWithAnnotation(String packagePrefix,
			Class<? extends Annotation> annotationClass, ClassLoader classloader); static Set<Method> getMethodsWithAnnotation(Class<? extends Annotation> annotationClass); static Set<Method> getMethodsWithAnnotation(Class<? extends Annotation> annotationClass,
			ClassLoader classloader); static Set<Method> getMethodsWithAnnotation(String packagePrefix,
			Class<? extends Annotation> annotationClass, ClassLoader classloader); static void clearCache();  }
@Test public void testMethod1() { Method method1 = CachedAnnotationScanner.getMethodsWithAnnotation(TestAnnotation.class).stream().findFirst().get(); assertEquals("testMethod", method1.getName()); }
@Test public void testMethod2() { Method method1 = CachedAnnotationScanner .getMethodsWithAnnotation(TestAnnotation.class, this.getClass().getClassLoader()).stream().findFirst() .get(); assertEquals("testMethod", method1.getName()); }
@Test public void testMethod3() { Method method1 = CachedAnnotationScanner .getMethodsWithAnnotation("step", TestAnnotation.class, this.getClass().getClassLoader()).stream() .findFirst().get(); assertEquals("testMethod", method1.getName()); }