@Test
void release() throws Exception
{

    final EmbeddableComponentManager ecm = new EmbeddableComponentManager();
    final DefaultComponentDescriptor<Role> cd = new DefaultComponentDescriptor<>();
    cd.setRoleType(Role.class);
    cd.setImplementation(RoleImpl.class);
    Role roleImpl = new RoleImpl();
    ecm.registerComponent(cd, roleImpl);
    final ComponentEventManager cem = mock(ComponentEventManager.class);
    ecm.setComponentEventManager(cem);
    ecm.release(roleImpl);
    verify(cem).notifyComponentUnregistered(cd, ecm);
    verify(cem).notifyComponentRegistered(cd, ecm);
    assertNotNull(ecm.getInstance(Role.class));
    assertNotSame(roleImpl, ecm.getInstance(Role.class));
}