code: public static TypeMirror getReturnType(TypeElement type, ExecutableElement method, Types types) {
      try {
        ExecutableType executableType = (ExecutableType)
            types.asMemberOf((DeclaredType) type.asType(), method);
        return executableType.getReturnType();
      } catch (IllegalArgumentException e) {
        // Eclipse incorrectly throws an IllegalArgumentException here:
        //    "element is not valid for the containing declared type"
        // As a workaround for the common case, fall back to the declared return type.
        return method.getReturnType();
      }
    }
docs: Determines the return type of {@code method}, if called on an instance of type {@code type}.
  
  <p>For instance, in this example, myY.getProperty() returns List&lt;T&gt;, not T:<pre><code>
  interface X&lt;T&gt; {
  T getProperty();
  }
  &#64;FreeBuilder interface Y&lt;T&gt; extends X&lt;List&lt;T&gt;&gt; { }</code></pre>
  
  <p>(Unfortunately, a bug in Eclipse prevents us handling these cases correctly at the moment.
  javac works fine.)