### Question:
ExceptionHandlingScraperWrapper implements WebScraper { @Override public void execute(final DynamicScopeContext context) { try { webScraper.execute(context); } catch (RuntimeException e) { eventBus.post(new ScraperExecutionErrorEvent(e)); } } @Inject  ExceptionHandlingScraperWrapper(
			final @Named("default") WebScraper webScraper,
			final EventBus eventBus); @Override void execute(final DynamicScopeContext context); @Override void informListenersAboutError(final Exception e);  }### Answer:
@Test public void execute() { final DynamicScopeContext context = mockContext.getMock(); webScraper.execute(same(context)); expectLastCall(); EasyMockUnitils.replay(); wrapper.execute(context); }
@Test public void executeIfRuntimeException() { final Capture capture = new Capture(); final RuntimeException exception = new RuntimeException(); final DynamicScopeContext context = mockContext.getMock(); webScraper.execute(same(context)); expectLastCall().andThrow(exception); eventBus.post(isA(ScraperExecutionErrorEvent.class)); expectLastCall().andAnswer(new IAnswer<Object>() { public Object answer() throws Throwable { capture.setCaptured(getCurrentArguments()[0]); return null; } }); EasyMockUnitils.replay(); wrapper.execute(context); final ScraperExecutionErrorEvent event = capture.<ScraperExecutionErrorEvent>getCaptured(); assertNotNull("Event is null.", event); final Exception ex = event.getException(); assertNotNull("Exception from event is null.", ex); assertSame("Unexpected exception.", exception, ex); }