StrategyStorageWithCacheStrategy implements IResolveDependencyStrategy, IAdditionDependencyStrategy, ICacheable { @Override public void dropCacheFor(final Object key) throws DropCacheException { try { this.cacheStrategiesMap.remove(key); } catch (Throwable e) { throw new DropCacheException(e); } } StrategyStorageWithCacheStrategy(final IFunction argToKeyFunction, final IBiFunction findValueByArgumentFunction); @Override T resolve(Object... args); @Override void register(Object key, IResolveDependencyStrategy value); @Override void remove(Object key); @Override void dropCache(); @Override void dropCacheFor(final Object key);  }
@Test (expected = DropCacheException.class) public void checkExceptionOnDropCache() throws Exception { IResolveDependencyStrategy cachedStrategy = new StrategyStorageWithCacheStrategy(null, null); ((ICacheable) cachedStrategy).dropCacheFor(null); }