Container implements IContainer { @Override public void register(final IKey key, final IResolveDependencyStrategy strategy) throws RegistrationException { try { IStrategyContainer strategyContainer = (IStrategyContainer) ScopeProvider.getCurrentScope().getValue(strategyContainerKey); strategyContainer.register(key, strategy); } catch (Throwable e) { throw new RegistrationException("Registration of dependency failed for key " + key, e); } } Container(); @Override IKey getIocKey(); @Override IKey getKeyForKeyStorage(); @Override T resolve(final IKey key, final Object ... args); @Override void register(final IKey key, final IResolveDependencyStrategy strategy); @Override void remove(final IKey key);  }
@Test (expected = RegistrationException.class) public void checkRegistrationException() throws Exception { IContainer container = new Container(); container.register(null, null); }