StrategyStorageStrategy implements IResolveDependencyStrategy, IAdditionDependencyStrategy { @Override public <T> T resolve(Object... args) throws ResolveDependencyStrategyException { try { IResolveDependencyStrategy strategy = (IResolveDependencyStrategy) this.findValueByArgumentFunction.execute(this.strategyStorage, args[0]); return null == strategy ? null : strategy.resolve(args); } catch (Exception e) { throw new ResolveDependencyStrategyException("Object resolution failed.", e); } } StrategyStorageStrategy(final IFunction argToKeyFunction, final IBiFunction findValueByArgumentFunction); @Override T resolve(Object... args); @Override void register(Object arg, IResolveDependencyStrategy value); @Override void remove(Object arg);  }
@Test (expected = ResolveDependencyStrategyException.class) public void checkResolutionException() throws Exception { IResolveDependencyStrategy sss = new StrategyStorageStrategy(null, null); sss.resolve(null); }