### Question:
AnnotationExtractor { public List<Set<Mdc>> getParametersMdcs(Method method) { return Stream.of(method.getParameters()) .map(parameter -> findAnnotationOnParameter(parameter, Mdc.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 getParametersMdcs() 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<Mdc>> parametersMdcs = annotationExtractor.getParametersMdcs(loggedOverriddenMethod); List<Set<Mdc>> emptyParametersMdcs = annotationExtractor.getParametersMdcs(overriddenMethod); List<Set<Mdc>> overriddenParametersMdcs = annotationExtractor.getParametersMdcs(overriddenNotGenericMethod); assertThat(parametersMdcs, hasSize(1)); Set<Mdc> parameterMdcs = parametersMdcs.iterator().next(); assertThat(parameterMdcs, hasSize(1)); assertThat(parameterMdcs.iterator().next().key(), isEmptyString()); assertThat(emptyParametersMdcs, hasSize(1)); Set<Mdc> parameterEmptyParametersMdcs = emptyParametersMdcs.iterator().next(); assertThat(parameterEmptyParametersMdcs, is(empty())); assertThat(overriddenParametersMdcs, hasSize(1)); Set<Mdc> parameterOverriddenParametersMdcs = overriddenParametersMdcs.iterator().next(); assertThat(parameterOverriddenParametersMdcs, is(empty())); }