UserObjectMethodInvokerReceiverCreator extends BasicIntermediateReceiverObjectCreator { @Override public void acceptItem(Object itemId, Object item) throws ReceiverObjectListenerException, InvalidReceiverPipelineException, InvalidArgumentException { if (null == item) { throw new InvalidArgumentException("Item is null."); } try { for (Method method : item.getClass().getDeclaredMethods()) { if (method.isSynthetic() || !Modifier.isPublic(method.getModifiers())) { continue; } IMessageReceiver methodInvoker = IOC.resolve( Keys.getOrAdd("method invoker receiver"), item, method, getFilterConfig() ); getListener().acceptItem(method.getName(), methodInvoker); } } catch (ResolutionException e) { throw new ReceiverObjectListenerException(e); } } UserObjectMethodInvokerReceiverCreator(
            final IReceiverObjectCreator underlyingObjectCreator,
            final IObject filterConfig,
            final IObject objectConfig); @Override Collection<Object> enumIdentifiers(IObject config, IObject context); @Override void acceptItem(Object itemId, Object item);  }
@Test public void Should_resolveInvokersForObjectMethods() throws Exception { IReceiverObjectCreator creator = new UserObjectMethodInvokerReceiverCreator(underlyingCreatorMock, filterConfigMock, configMock); creator.create(listenerMock, configMock, contextMock); verify(listenerMock).acceptItem(eq("method1"), same(invokerMocks[0])); verify(listenerMock).acceptItem(eq("method2"), same(invokerMocks[1])); verify(listenerMock).endItems(); verifyNoMoreInteractions(listenerMock); }