MethodHierarchyReader { @VisibleForTesting static boolean isServiceMethod(Method method) { int modifiers = method.getModifiers(); return Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && !method.isBridge(); } MethodHierarchyReader(Class<?> endpointClass); Iterable<Method> getLeafMethods(); Iterable<EndpointMethod> getLeafEndpointMethods(); Iterable<List<Method>> getMethodOverrides(); Iterable<List<EndpointMethod>> getEndpointOverrides(); Map<String, Method> getNameToLeafMethodMap(); ListMultimap<String, EndpointMethod> getNameToEndpointOverridesMap();  }
@Test public void testIsServiceMethod_normal() throws Exception { Method normal = TestEndpoint.class.getMethod("getDate", Date.class); assertTrue(MethodHierarchyReader.isServiceMethod(normal)); }
@Test public void testIsServiceMethod_normalOverride() throws Exception { Method override = TestEndpoint.class.getMethod("overrideMethod1"); assertTrue(MethodHierarchyReader.isServiceMethod(override)); }
@Test public void testIsServiceMethod_isBridge() throws Exception { Method bridgeMethod = TestEndpoint.class.getMethod("overrideMethod", Object.class); assertFalse(MethodHierarchyReader.isServiceMethod(bridgeMethod)); }
@Test public void testIsServiceMethod_isStatic() throws Exception { Method staticMethod = TestEndpoint.class.getMethod("staticMethod"); assertFalse(MethodHierarchyReader.isServiceMethod(staticMethod)); }