title: How to get Generic Return type of a method using Reflections
body: <p>Is there a way get the return type of a generic method- return type?</p>
  
  <pre><code>public interface MyGeneric&lt;T&gt; {
    T doSomething();
  }
  
  public interface MyElement extends MyGeneric&lt;Element&gt; {
  
  }
  
  public class Main {
    public static final void main(String[] args) {
      System.out.println(MyElement.class.getMethod("doSomething", new Class&lt;?&gt;[0]).magic()); // =&gt; Element
    }
  }
  </code></pre>
  
  <p>Using Method.getReturnType() I get java.lang.Object without. Does the method "magic" exist?</p>