### Question:
AnnotationUtils { public static Method getAnnotatedMethod(Class<?> serviceClass, Method m) { Method annotatedMethod = doGetAnnotatedMethod(serviceClass, m); return annotatedMethod == null ? m : annotatedMethod; } private  AnnotationUtils(); static int getBindingPriority(Class<?> providerCls); static Set<String> getNameBindings(Annotation[] targetAnns); static boolean isParamAnnotationClass(Class<?> annotationClass); static boolean isValidParamAnnotationClass(Class<?> annotationClass); static boolean isValidParamAnnotations(Annotation[] paramAnnotations); static boolean isMethodAnnotation(Annotation a); static String getAnnotationValue(Annotation a); static T getAnnotation(Annotation[] anns, Class<T> type); static Method getAnnotatedMethod(Class<?> serviceClass, Method m); static String getHttpMethodValue(Method m); static A getMethodAnnotation(Method m, Class<A> aClass); static A getClassAnnotation(Class<?> c, Class<A> aClass); static String getDefaultParameterValue(Annotation[] anns);  }### Answer:
@Test public void testGetAnnotatedMethodFromInterface() throws Exception { Method m = Customer.class.getMethod("setUriInfoContext", new Class[]{UriInfo.class}); assertEquals(0, m.getAnnotations().length); assertEquals(0, m.getParameterAnnotations()[0].length); Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(Customer.class, m); assertNotSame(m, annotatedMethod); assertEquals(1, annotatedMethod.getParameterAnnotations()[0].length); }
@Test public void testGetAnnotatedMethodFromClass() throws Exception { Method m = Customer.class.getMethod("getContextResolver", new Class[]{}); assertEquals(0, m.getAnnotations().length); Method annotatedMethod = AnnotationUtils.getAnnotatedMethod(Customer.class, m); assertSame(m, annotatedMethod); }