@Test
public void testDeepGenericHierarchyFailEndpoint() throws Exception {

  ApiConfig config = createConfig(DeepGenericHierarchyFailEndpoint.class);
  annotationReader.loadEndpointMethods(serviceContext, DeepGenericHierarchyFailEndpoint.class,
      config.getApiClassConfig().getMethods());
  ApiMethodConfig method1 =
      config.getApiClassConfig().getMethods().get(methodToEndpointMethod(
          DeepGenericHierarchyFailEndpoint.class,
          DeepGenericHierarchyFailEndpoint.class.getMethod("foo", String.class, Integer.class,
              Collection.class)));
  assertEquals("DeepGenericHierarchyFailEndpoint.foo", method1.getName());
  ApiMethodConfig method2 =
      config.getApiClassConfig().getMethods().get(methodToEndpointMethod(
          DeepGenericHierarchyFailEndpoint.class,
          DeepGenericHierarchyFailEndpoint.class.getSuperclass().getSuperclass().getSuperclass()
              .getMethod("foo", Object.class, Object.class, Object.class)));
  assertEquals("Endpoint3.foo", method2.getName());
}