### Question:
AnnotationExtractor { public List<Set<Log>> getParameterLogs(Method method) { return Stream.of(method.getParameters()) .map(parameter -> findAnnotationOnParameter(parameter, Log.class)) .collect(toList()); } private  AnnotationExtractor(); static AnnotationExtractor getInstance(); Set<Method> getCandidateMethods(Class<?> clazz); boolean hasAnyAnnotation(Method method); boolean hasAnyAnnotation(Parameter parameter); Set<Log> getLogs(Method method); Set<Log.in> getLogIns(Method method); Set<Log.out> getLogOuts(Method method); Set<Log.error> getLogErrors(Method method); Set<Mdc> getMdcs(Method method); List<Set<Log>> getParameterLogs(Method method); List<Set<Mdc>> getParametersMdcs(Method method);  }### Answer:
@Test public void getParameterLogs() throws NoSuchMethodException { Method loggedOverriddenMethod = AnnotatedChild.class.getMethod("loggedOverriddenMethod", String.class); Method overriddenMethod = AnnotatedChild.class.getMethod("overriddenMethod", String.class); Method overriddenNotGenericMethod = AnnotatedChild.class.getMethod("overriddenNotGenericMethod", String.class); List<Set<Log>> logs = annotationExtractor.getParameterLogs(loggedOverriddenMethod); List<Set<Log>> emptyLogs = annotationExtractor.getParameterLogs(overriddenMethod); List<Set<Log>> overriddenLogs = annotationExtractor.getParameterLogs(overriddenNotGenericMethod); assertThat(logs, hasSize(1)); Set<Log> parameterLogs = logs.iterator().next(); assertThat(parameterLogs, hasSize(1)); assertThat(parameterLogs.iterator().next().level(), is(DEBUG)); assertThat(emptyLogs, hasSize(1)); Set<Log> emptyParameterLogs = emptyLogs.iterator().next(); assertThat(emptyParameterLogs, is(empty())); assertThat(overriddenLogs, hasSize(1)); Set<Log> overriddenParameterLogs = overriddenLogs.iterator().next(); assertThat(overriddenParameterLogs, is(empty())); }
@Test public void getParameterMetaLogs() throws NoSuchMethodException { Method method = MetaAnnotated.class.getMethod("method", int.class); List<Set<Log>> parameterLogs = annotationExtractor.getParameterLogs(method); assertThat(parameterLogs, hasSize(1)); assertThat(parameterLogs.get(0), hasSize(1)); }