### Question:
AnnotationExtractor { public Set<Method> getCandidateMethods(Class<?> clazz) { return Stream.of(ReflectionUtils.getUniqueDeclaredMethods(clazz)) .filter(method -> method.getDeclaringClass() != Object.class) .filter(method -> !(method.isBridge() || method.isSynthetic())) .collect(toSet()); } 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 getCandidateMethodsFromObject() { Class<?> clazz = Object.class; Set<Method> methods = annotationExtractor.getCandidateMethods(clazz); assertThat(methods, is(empty())); }
@Test public void getCandidateMethodsWithInheritanceAndGeneric() throws NoSuchMethodException { Method childMethod = Child.class.getMethod("method", NullPointerException.class); Method parentMethod = Parent.class.getDeclaredMethod("parentMethod"); Method interfaceMethod = Interface.class.getMethod("interfaceMethod"); Set<Method> methods = annotationExtractor.getCandidateMethods(Child.class); assertThat(methods, hasSize(3)); assertThat(methods, containsInAnyOrder(childMethod, parentMethod, interfaceMethod)); }