MethodEndpoint { public Object invoke(Object... args) throws Exception { Object endpoint = getBean(); ReflectionUtils.makeAccessible(method); try { return method.invoke(endpoint, args); } catch (InvocationTargetException ex) { handleInvocationTargetException(ex); throw new IllegalStateException("Unexpected exception thrown by method - " + ex.getTargetException().getClass().getName() + ": " + ex.getTargetException().getMessage()); } } MethodEndpoint(Object bean, Method method);  MethodEndpoint(Object bean, String methodName, Class<?>... parameterTypes);  MethodEndpoint(String beanName, BeanFactory beanFactory, Method method); Object getBean(); Method getMethod(); MethodParameter[] getMethodParameters(); MethodParameter getReturnType(); Object invoke(Object... args); boolean equals(Object o); int hashCode(); String toString();  }
@Test public void testInvoke() throws Exception { Assert.assertFalse("Method invoked before invocation", myMethodInvoked); endpoint.invoke("arg"); Assert.assertTrue("Method invoked before invocation", myMethodInvoked); }