ComponentDescriptorRemovedEvent extends AbstractComponentDescriptorEvent { @Override public boolean matches(Object otherEvent) { boolean result = false; if (ComponentDescriptorRemovedEvent.class.isAssignableFrom(otherEvent.getClass())) { result = super.matches(otherEvent); } return result; } ComponentDescriptorRemovedEvent();  ComponentDescriptorRemovedEvent(Class<?> role);  ComponentDescriptorRemovedEvent(Type roleType);  ComponentDescriptorRemovedEvent(Class<?> role, String roleHint);  ComponentDescriptorRemovedEvent(Type roleType, String roleHint); @Override boolean matches(Object otherEvent);  }
@Test void matchesAllComponentRoles() { ComponentDescriptorRemovedEvent event = new ComponentDescriptorRemovedEvent(); assertTrue(event.matches(new ComponentDescriptorRemovedEvent((Type) Dummy.class, "rolehint"))); }
@Test void matchesWhenDifferentEvent() { ComponentDescriptorRemovedEvent event = new ComponentDescriptorRemovedEvent(); assertFalse(event.matches((Event) e -> false)); }
@Test void matchesWhenSpecificRoleSpecified() { ComponentDescriptorRemovedEvent event = new ComponentDescriptorRemovedEvent((Type) Dummy.class); assertTrue(event.matches(new ComponentDescriptorRemovedEvent((Type) Dummy.class, "rolehint"))); assertFalse(event.matches(new ComponentDescriptorRemovedEvent((Type) ComponentDescriptorRemovedEvent.class, "rolehint"))); }