### Question:
AnnotationExtractor { public Set<Log.error> getLogErrors(Method method) { return findAnnotationOnMethodOrBridge(method, Log.error.class); } 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 getLogErrors() 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); Set<Log.error> logErrors = annotationExtractor.getLogErrors(loggedOverriddenMethod); Set<Log.error> bridgedLogErrors = annotationExtractor.getLogErrors(overriddenMethod); Set<Log.error> overriddenLogErrors = annotationExtractor.getLogErrors(overriddenNotGenericMethod); assertThat(logErrors, hasSize(1)); assertThat(logErrors.iterator().next().level(), is(DEBUG)); assertThat(bridgedLogErrors, hasSize(1)); assertThat(bridgedLogErrors.iterator().next().level(), is(INFO)); assertThat(overriddenLogErrors, hasSize(1)); assertThat(overriddenLogErrors.iterator().next().level(), is(INFO)); }
@Test public void getLogErrorsOrder() throws NoSuchMethodException { Method loggedOverriddenMethod = AnnotatedChild.class.getDeclaredMethod("errorsOrder"); Set<Log.error> logErrors = annotationExtractor.getLogErrors(loggedOverriddenMethod); assertThat(logErrors, hasSize(5)); Iterator<Log.error> logErrorsIterator = logErrors.iterator(); assertThat(logErrorsIterator.next().level(), is(TRACE)); assertThat(logErrorsIterator.next().level(), is(DEBUG)); assertThat(logErrorsIterator.next().level(), is(INFO)); assertThat(logErrorsIterator.next().level(), is(WARN)); assertThat(logErrorsIterator.next().level(), is(ERROR)); }