EndpointMethod { public Method getMethod() { return method; } private  EndpointMethod(Class<?> endpointClass, Method method, TypeToken<?> declaringClass); static Class<?> getClassFromType(Type type); Class<?> getEndpointClass(); Method getMethod(); TypeToken<?> getReturnType(); TypeToken<?>[] getParameterTypes(); Class<?>[] getParameterClasses(); static EndpointMethod create(
      Class<?> endpointClass, Method method, TypeToken<?> declaringClass); static EndpointMethod create(Class<?> endpointClass, Method method); ResolvedSignature getResolvedMethodSignature(); @Override boolean equals(Object o); @Override String toString(); @Override int hashCode(); List<String> getParameterNames(); void setParameterNames(List<String> parameterNames);  }
@Test public void testMethodFromWrongClassChain() throws SecurityException, NoSuchMethodException { Class<?> clazz = ChildClassList.class; Method method = ParameterizedList.class.getMethod("foo", List.class); try { getEndpointMethod(clazz, method); fail(String.format("Method %s is not part of '%s's inheritance chain", clazz, method)); } catch (IllegalArgumentException expected) { } }
@Test public void testMethodFromRightClassChain() throws SecurityException, NoSuchMethodException { Class<?> clazz = ChildClassList.class; Method method = RawList.class.getMethod("foo", List.class); getEndpointMethod(clazz, method); }