EventManagerImpl extends LifecycleSupport implements EventManager { @Override public void publish(final Object event) { checkNotNull(event); log.trace("Publishing event: {}", event); eventBus.post(event); } @Inject  EventManagerImpl(final BeanContainer container); @VisibleForTesting void setDiscoveryEnabled(final boolean discoveryEnabled); @Override void register(final Object listener); @Override void unregister(final Object listener); @Override void publish(final Object event);  }
@Test public void testPublish() throws Exception { try { underTest.publish(null); fail(); } catch (NullPointerException e) { } Object event = new Object(); underTest.publish(event); }