@Override
  public Sdk createRemoteSdk(@Nullable Project project, @NotNull T data, @Nullable String sdkName, Collection<Sdk> existingSdks)
    throws RemoteSdkException {
    final String sdkVersion = getSdkVersion(project, data);

    final String name;
    if (StringUtil.isNotEmpty(sdkName)) {
      name = sdkName;
    }
    else {
      name = getSdkName(data, sdkVersion);
    }

    final SdkType sdkType = getSdkType(data);

    final Sdk sdk = createSdk(existingSdks, sdkType, data, name);

    SdkModificator sdkModificator = sdk.getSdkModificator();
    sdkModificator.setVersionString(sdkVersion);

    var modifiableAdditionalData = sdkModificator.getSdkAdditionalData();
    if (!(modifiableAdditionalData instanceof RemoteSdkAdditionalData remoteSdkAdditionalData)) {
      LOG.error("Expected remote additional data, got " + modifiableAdditionalData + " in " + sdk);
      throw new RemoteSdkException("Internal error");
    }
    remoteSdkAdditionalData.setValid(true);

    Application application = ApplicationManager.getApplication();
    Runnable runnable = () -> sdkModificator.commitChanges();
    if (application.isDispatchThread()) {
      application.runWriteAction(runnable);
    } else {
      application.invokeAndWait(() -> application.runWriteAction(runnable));
    }

    return sdk;
  }
@Override
  public Sdk createRemoteSdk(@Nullable Project project, @NotNull T data, @Nullable String sdkName, Collection<Sdk> existingSdks)