private static @Nullable Object fixArg(@Nullable Object arg, @NotNull Class<?> fieldClass) {
    if (arg == null) return null;
    if (!fieldClass.isPrimitive() && Proxy.isProxyClass(arg.getClass())) {
      InvocationHandler handler = Proxy.getInvocationHandler(arg);
      RemoteInvocationHandler remoteHandler = ObjectUtils.tryCast(handler, RemoteInvocationHandler.class);
      boolean isCastableArg = remoteHandler != null && CastableArgument.class.isAssignableFrom(remoteHandler.myRemote.getClass());
      if (isCastableArg && remoteHandler.myClazz == fieldClass) return remoteHandler.myRemote;
    }
    return arg;
  }
private static @Nullable Object fixArg(@Nullable Object arg, @NotNull Class<?> fieldClass)