### Question:
ScrapingAwareTypeListener implements TypeListener { @Override public <I> void hear(final TypeLiteral<I> type, final TypeEncounter<I> encounter) { final Provider<ScrapingAwareHelper> provider = encounter .getProvider(ScrapingAwareHelper.class); encounter.register(new InjectionListener<I>() { @Override public void afterInjection(I i) { if (i instanceof ScrapingAware) { provider.get().addListener((ScrapingAware) i); } } }); }  @Override void hear(final TypeLiteral<I> type,
            final TypeEncounter<I> encounter);  }### Answer:
@Test public void testApplyInjection() { final Capture capture = new Capture(); expect(mockEncounter.getProvider(ScrapingAwareHelper.class)). andReturn(mockProvider); mockEncounter.register(isA(InjectionListener.class)); expectLastCall().andAnswer(new IAnswer<Object>() { public Object answer() throws Throwable { capture.setCaptured(getCurrentArguments()[0]); return null; } }); expect(mockProvider.get()).andReturn(mockAwareHelper); mockAwareHelper.addListener(mockAwareObject); expectLastCall(); EasyMockUnitils.replay(); listener.hear(mockTypeLiteral, mockEncounter); final InjectionListener<Object> injectionListener = capture.getCaptured(); assertNotNull(listener); injectionListener.afterInjection(mockAwareObject); injectionListener.afterInjection(this); }