title: How to get annotations of interface or abstract class methods in Java
body: <p>I have an interface like this:</p>
  
  <pre><code>public interface IFoo{
  @AnnotationTest(param="test")
  String invoke();
  }
  </code></pre>
  
  <p>and I implement this like this:</p>
  
  <pre><code>public class Foo implements IFoo{
  @Override
  public String invoke(){
    Method method = new Object() {
          }.getClass().getEnclosingMethod();
    AnnotationTest ann = method.getAnnotation(AnnotationTest.class);
    if(ann == null){
      System.out.printl("Parent method's annotation is unreachable...")
  }
  
  }
  
  }
  </code></pre>
  
  <p>If it is possible to reach parent's annotation, I want to learn the way of it.</p>
  
  <p>Any help or idea will be appreciated.</p>