RegisterInjectedEventListeners implements InjectionListener<I> { @Override public void afterInjection(final Object injectee) { eventCasterProvider.get().registerListener(interfaceType, injectee); } protected  RegisterInjectedEventListeners(
            final TypeLiteral<?> interfaceType,
            final Provider<EventCasterInternal> eventCasterProvider); @Override void afterInjection(final Object injectee); @Override boolean equals(final Object that);  }
@Test public void injectedObjectIsRegisteredWithTheEventCaster() { context.checking(new Expectations() {{ oneOf(eventCasterProvider).get(); will(returnValue(eventCaster)); oneOf(eventCaster).registerListener(TypeLiteral.get(MyListener.class), injectee); }}); new RegisterInjectedEventListeners<Object>(TypeLiteral.get(MyListener.class), eventCasterProvider).afterInjection(injectee); }