### Question:
ApplicationEventDistributionServiceImpl implements ApplicationEventDistributionService { @Override public void subscribe(@Nonnull final ApplicationEventListener eventListener) { Assert.notNull(eventListener, "Event listener should not be null"); LOGGER.debug("Subscribing event listener - {}", eventListener); this.eventListeners.add(eventListener); } ApplicationEventDistributionServiceImpl(); @Override void subscribe(@Nonnull final ApplicationEventListener eventListener); @Override void publishAsynchronousEvent(@Nonnull final ApplicationEvent applicationEvent); @Override void publishSynchronousEvent(@Nonnull final ApplicationEvent applicationEvent); PersistenceUtilityService getPersistenceUtilityService(); void setPersistenceUtilityService(final PersistenceUtilityService persistenceUtilityService); void setExecutorService(final ExecutorService executorService);  }### Answer:
@Test public void testSubscribeWithInvalidArguments() { resetAll(); replayAll(); try { applicationEventDistributionService.subscribe(null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testSubscribe() { resetAll(); replayAll(); applicationEventDistributionService.subscribe(new ApplicationEventListener() { @Nonnull @Override public boolean subscribed(@Nonnull ApplicationEvent applicationEvent) { return false; } @Override public void process(@Nonnull ApplicationEvent applicationEvent) { } }); verifyAll(); }