private static Class<?> castArgumentClassToLocal(@NotNull Class<?> remote) {
    try {
      if (!CastableArgument.class.isAssignableFrom(remote)) return remote;
      Type[] generics = remote.getGenericInterfaces();
      for (Type generic : generics) {
        if (generic instanceof ParameterizedType) {
          Type rawType = ((ParameterizedType)generic).getRawType();
          if (rawType == CastableArgument.class) return (Class<?>)((ParameterizedType)generic).getActualTypeArguments()[0];
        }
      }
    }
    catch (Exception ignore) {
    }
    return remote;
  }
private static Class<?> castArgumentClassToLocal(@NotNull Class<?> remote)