title: Get a in a interface annotated method from class
body: <p>I want to access Method via reflection. The problem is that the Method is annotated in an interface:</p>
  
  <pre><code>public interface MyRepository extends CrudRepository&lt;MyClass, Long&gt; {
  
      @CustomAnnotation
      MyClass findByName(String name);
  }
  </code></pre>
  
  <p>As you see I use Spring which provides a class that will implement this Repository interface.
  I want to create a method, that will get a Repository and invoke all methods that are annotated with <code>@CustomAnnotation</code>. </p>
  
  <pre><code>public void do(Repository&lt;?, ?&gt; repository){
     Method[] methods=repository.getClass().getMethodThatAreAnnotatedInInterfaceWith(CustomAnnotation.class);
     ....
  }
  </code></pre>
  
  <p>Because the implementation of an interface won’t have the annotations of the interface present, I do not know how to query these methods.</p>