class AnnotationMethodResolver implements MethodResolver {

	private final Class<? extends Annotation> annotationType;

	/**
	 * Create a MethodResolver for the specified Method-level annotation type
	 * @param annotationType the type of the annotation
	 */
	public AnnotationMethodResolver(Class<? extends Annotation> annotationType) {
		Assert.notNull(annotationType, "annotationType must not be null");
		Assert.isTrue(
				ObjectUtils.containsElement(annotationType.getAnnotation(Target.class).value(), ElementType.METHOD),
				"Annotation [" + annotationType + "] is not a Method-level annotation.");
		this.annotationType = annotationType;
	}

	/**
	 * Find a <em>single</em> Method on the Class of the given candidate object that
	 * contains the annotation type for which this resolver is searching.
	 * @param candidate the instance whose Class will be checked for the annotation
	 * @return a single matching Method instance or <code>null</code> if the candidate's
	 * Class contains no Methods with the specified annotation
	 * @throws IllegalArgumentException if more than one Method has the specified
	 * annotation
	 */
	public Method findMethod(Object candidate) {<FILL_FUNCTION_BODY>}

	/**
	 * Find a <em>single</em> Method on the given Class that contains the annotation type
	 * for which this resolver is searching.
	 * @param clazz the Class instance to check for the annotation
	 * @return a single matching Method instance or <code>null</code> if the Class
	 * contains no Methods with the specified annotation
	 * @throws IllegalArgumentException if more than one Method has the specified
	 * annotation
	 */
	public Method findMethod(final Class<?> clazz) {
		Assert.notNull(clazz, "class must not be null");
		final AtomicReference<Method> annotatedMethod = new AtomicReference<>();
		ReflectionUtils.doWithMethods(clazz, method -> {
			Annotation annotation = AnnotationUtils.findAnnotation(method, annotationType);
			if (annotation != null) {
				Assert.isNull(annotatedMethod.get(), "found more than one method on target class [" + clazz
						+ "] with the annotation type [" + annotationType + "]");
				annotatedMethod.set(method);
			}
		});
		return annotatedMethod.get();
	}

}

		Assert.notNull(candidate, "candidate object must not be null");
		Class<?> targetClass = AopUtils.getTargetClass(candidate);
		if (targetClass == null) {
			targetClass = candidate.getClass();
		}
		return this.findMethod(targetClass);
	
<no_super_class>