Java tutorial
//package com.java2s; import java.lang.annotation.Annotation; import java.lang.reflect.Method; public class Main { public static Boolean hasAnnotation(Method method, Class<? extends Annotation> annotation) { return method.getAnnotation(annotation) != null; } }