AspectJUtils { public <T extends Annotation> AnnotatedMethodParam<T> findAnnotatedMethodParam(ProceedingJoinPoint pjp, Class<T> searchedAnnotation) { AnnotatedMethodParam<T> res = null; List<AnnotatedMethodParam<T>> annotatedMethodParams = AspectJUtils.this.findAnnotatedMethodParams(pjp, searchedAnnotation, true); if (!annotatedMethodParams.isEmpty()) { res = annotatedMethodParams.get(0); } return res; }  AnnotatedMethodParam<T> findAnnotatedMethodParam(ProceedingJoinPoint pjp, Class<T> searchedAnnotation); List<AnnotatedMethodParam<T>> findAnnotatedMethodParams(ProceedingJoinPoint pjp, Class<T> searchedAnnotation);  }
@Test public void testFindAnnotatedMethodParam() throws NoSuchMethodException { AnnotatedMethodParam<ForTest> findAnnotatedMethodParam = aspectJUtils.findAnnotatedMethodParam(getJoinPointMock(), ForTest.class); assertEquals("nameForTest", findAnnotatedMethodParam.getAnnotation().name()); assertEquals("stringForTest", findAnnotatedMethodParam.getArg()); }