### Question:
AuditService { public static Object getAnnotatedParamValue(Method method, Object[] parameters, Class<?> expectedAnnotation) { Annotation[][] annotations = method.getParameterAnnotations(); int parameterPosition = 0; for (Annotation[] paramAnnotations : annotations) { for (Annotation ann : paramAnnotations) { if (ann.annotationType().equals(expectedAnnotation)) { return parameters[parameterPosition]; } } parameterPosition++; } return null; }  void auditMethod(Method method, Object[] parameters); static Object getAnnotatedParamValue(Method method, Object[] parameters, Class<?> expectedAnnotation);  }### Answer:
@Test public void testGetAnnotatedParamValue() throws Exception { String id = "id"; Long data = new Long(100); methodTestOkBoth(id, data); methodTestOnlyData(id, data); methodTestOnlyData(data); methodTestOnlyId(id, data); methodTestOnlyId(id); methodTestNoAnnotations(id, data); methodTestNoAnnotations(id); methodTestNoAnnotations(); }