MethodEndpoint { public int hashCode() { return 31 * this.bean.hashCode() + this.method.hashCode(); } 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 testHashCode() throws Exception { Assert.assertEquals("Not equal", new MethodEndpoint(this, method).hashCode(), endpoint.hashCode()); Method otherMethod = getClass().getMethod("testEquals"); Assert.assertFalse("Equal", new MethodEndpoint(this, otherMethod).hashCode() == endpoint.hashCode()); }