EmbeddableComponentManager implements NamespacedComponentManager, Disposable { @Override public void unregisterComponent(Type role, String hint) { removeComponentWithoutException(role, hint); } EmbeddableComponentManager();  EmbeddableComponentManager(String namespace); @Override String getNamespace(); void initialize(ClassLoader classLoader); @Override boolean hasComponent(Type role); @Override boolean hasComponent(Type roleType, String roleHint); @Override T getInstance(Type roleType); @Override T getInstance(Type roleType, String roleHint); @Override List<T> getInstanceList(Type role); @Override @SuppressWarnings("unchecked") Map<String, T> getInstanceMap(Type roleType); @Override @SuppressWarnings("unchecked") ComponentDescriptor<T> getComponentDescriptor(Type role, String hint); @Override @SuppressWarnings("unchecked") List<ComponentDescriptor<T>> getComponentDescriptorList(Type role); @Override ComponentEventManager getComponentEventManager(); @Override void setComponentEventManager(ComponentEventManager eventManager); @Override ComponentManager getParent(); @Override void setParent(ComponentManager parentComponentManager); @Override void registerComponent(ComponentDescriptor<T> componentDescriptor); @Override void registerComponent(ComponentDescriptor<T> componentDescriptor, T componentInstance); @Override void unregisterComponent(Type role, String hint); @Override void unregisterComponent(ComponentDescriptor<?> componentDescriptor); @Override void release(Object component); @Override void dispose(); @Override @Deprecated List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> role);  }
@Test void unregisterComponent() throws Exception { EmbeddableComponentManager ecm = new EmbeddableComponentManager(); DefaultComponentDescriptor<Role> d1 = new DefaultComponentDescriptor<>(); d1.setRoleType(Role.class); d1.setImplementation(RoleImpl.class); ecm.registerComponent(d1); assertSame(RoleImpl.class, ecm.getInstance(Role.class).getClass()); ecm.unregisterComponent(d1.getRoleType(), d1.getRoleHint()); Throwable exception = assertThrows(ComponentLookupException.class, () -> { ecm.getInstance(d1.getRoleType()); }); }