ReflectionCache { public static void clearAll() { clearAllActions.forEach(Runnable::run); } ReflectionCache(SerializableFunction<Class<C>, T> valueProvider); T get(Class<? extends C> type); boolean contains(Class<? extends C> type); void clear(); static Registration addClearAllAction(Runnable action); static void clearAll();  }
@Test public void clearAll() { ReflectionCache<Object, Object> cache1 = new ReflectionCache<>( type -> type); ReflectionCache<Object, Object> cache2 = new ReflectionCache<>( type -> type); cache1.get(Object.class); cache2.get(Object.class); ReflectionCache.clearAll(); Assert.assertFalse(cache1.contains(Object.class)); Assert.assertFalse(cache2.contains(Object.class)); }