CachedAnnotationScanner { public static void clearCache() { Collection<AnnotationScanner> values = new ArrayList<>(annotationScanners.values()); annotationScanners.clear(); values.forEach(v -> { v.close(); }); }  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 testClearCache() { Method method1 = CachedAnnotationScanner.getMethodsWithAnnotation(TestAnnotation.class).stream().findFirst().get(); assertEquals("testMethod", method1.getName()); CachedAnnotationScanner.clearCache(); method1 = CachedAnnotationScanner.getMethodsWithAnnotation(TestAnnotation.class).stream().findFirst().get(); assertEquals("testMethod", method1.getName()); }