EventManagerImpl extends LifecycleSupport implements EventManager { @Override public void unregister(final Object listener) { checkNotNull(listener); log.trace("Removing listener: {}", listener); eventBus.unregister(listener); } @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 testRemoveListener() throws Exception { try { underTest.unregister(null); fail(); } catch (NullPointerException e) { } try { underTest.unregister(listener); } catch (IllegalArgumentException e) { } }