AbstractDomainProvider implements DomainProvider { @Override public List<Class<? extends Event>> getEvents() { List<Class<? extends Event>> events = new ArrayList<Class<? extends Event>>(); for (Method m : domainEventInterface.getDeclaredMethods()) { if (!isEventMethod(m)) { continue; } events.add(getEventParameter(m)); } return events; } @SuppressWarnings("unchecked")  AbstractDomainProvider(); @Override String getId(); void setId(String id); @Override LocalizableString getName(); @Override LocalizableString getDescription(); @Override Class<? extends DomainEvents> getDomainEventInterface(); @Override List<Class<? extends Event>> getEvents(); @Override Class<DomainType> getDomainInterface(); void setBundleContext(BundleContext bundleContext);  }
@Test public void testGetEvents_shouldReturnDummyEvent() throws Exception { List<Class<? extends Event>> events = provider.getEvents(); assertThat(events.contains(NullEvent.class), is(true)); assertThat(events.size(), is(1)); }