public void assertEmitted(Class<?> clazz, int eventsCount) {
    if (eventsCount < 0) throw new IllegalArgumentException("eventsCount cannot be less than 0!");
    List<Object> eventList = events.get(clazz);
    if (eventList == null && eventsCount > 0) {
      throw new AssertionError("Expected " + eventsCount + " of " + clazz.getCanonicalName() + ", was 0");
    }
    if (eventList.size() != eventsCount) {
      throw new AssertionError("Expected " + eventsCount + " of " + clazz.getCanonicalName() + ", was " + eventList.size());
    }
  }