guava/src/com/google/common/reflect/Invokable.java
@SuppressWarnings("unchecked")
  @CanIgnoreReturnValue
  public final R invoke(@Nullable T receiver, Object... args)
      throws InvocationTargetException, IllegalAccessException {
    return (R) invokeInternal(receiver, checkNotNull(args));
  }
@SuppressWarnings("unchecked")
  @CanIgnoreReturnValue
  public final R invoke(@Nullable T receiver, Object... args)
      throws InvocationTargetException, IllegalAccessException {
    return (R) invokeInternal(receiver, checkNotNull(args));
  }
All subclasses are owned by us and we'll make sure to get the R type right.