Container implements IContainer { @Override public void remove(final IKey key) throws DeletionException { try { IStrategyContainer strategyContainer = (IStrategyContainer) ScopeProvider.getCurrentScope().getValue(strategyContainerKey); strategyContainer.remove(key); } catch (Throwable e) { throw new DeletionException("Deletion 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 = DeletionException.class) public void checkDeletionException() throws Exception { IContainer container = new Container(); container.remove(null); }