Java tutorial
//package com.java2s; import java.lang.annotation.Annotation; import java.lang.reflect.Method; public class Main { static <T extends Annotation> T getSuperMethodAnnotation(Class<?> superClass, Method method, Class<T> annotationClass) { try { return superClass.getMethod(method.getName(), method.getParameterTypes()) .getAnnotation(annotationClass); } catch (NoSuchMethodException ignored) { return null; } } }