### Question:
DefaultHandlerHolder implements HandlerHolder,
        ScrapingAware { @Override public void onAfterScraping(final Harvester harvester) { if (harvester == null) { throw new IllegalArgumentException("Harvester is required"); } final EventBus eventBus = registry.lookup(harvester); if (eventBus == null) { throw new IllegalStateException("Cound not find event bus"); } for (final EventHandler<?> handler : handlers) { eventBus.unregister(handler); LOG.debug("Unregistered event bus handler [{}]", handler); } registry.unbind(harvester); } @Inject  DefaultHandlerHolder(final Registry<Harvester, EventBus> registry,
            final Provider<EventBus> provider); @Override void register(final EventHandler<?> handler); @Override void onBeforeScraping(final Harvester harvester); @Override void onAfterScraping(final Harvester harvester);  }### Answer:
@Test(expectedExceptions=IllegalArgumentException.class) public void testOnAfterScrapingWithoutHarvester() { holder.onAfterScraping(null); }
@Test public void testOnAfterScraping() throws Exception { expect(mockRegistry.lookup(mockHarvester)).andReturn(mockEventBus); mockEventBus.unregister(mockHandler); expectLastCall(); mockRegistry.unbind(mockHarvester); expectLastCall(); EasyMockUnitils.replay(); holder.register(mockHandler); holder.onAfterScraping(mockHarvester); }