public static Type resolveReturnType(Type baseType, Type overridingType) {
    if (baseType instanceof Class
        && overridingType instanceof Class
        && ((Class<?>) baseType).isAssignableFrom((Class<?>) overridingType)) {
      // NOTE: javac generates multiple same methods for multiple inherited generic interfaces
      return overridingType;
    }
    if (baseType instanceof Class && overridingType instanceof ParameterizedType) {
      // NOTE: javac will generate multiple methods with different return types
      // base interface declares generic method, override declares parameterized generic method
      return overridingType;
    }
    if (baseType instanceof Class && overridingType instanceof TypeVariable) {
      // NOTE: javac will generate multiple methods with different return types
      // base interface declares non generic method, override declares generic method
      return overridingType;
    }
    return baseType;
  }
Returns the declaring class of {@code typeVariable}, or {@code null} if it was not declared by
a class.
core/src/main/java/feign/Types.java