@NotNull
  public static Sdk createSdk(@NotNull Collection<? extends Sdk> allSdks,
                              @NotNull String homePath,
                              @NotNull SdkType sdkType,
                              @Nullable SdkAdditionalData additionalData,
                              @Nullable String customSdkSuggestedName) {
    final String sdkName = customSdkSuggestedName == null
                           ? createUniqueSdkName(sdkType, homePath, allSdks)
                           : createUniqueSdkName(customSdkSuggestedName, allSdks);

    Sdk sdk = ProjectJdkTable.getInstance().createSdk(sdkName, sdkType);
    SdkModificator sdkModificator = sdk.getSdkModificator();
    if (additionalData != null) {
      // additional initialization.
      // E.g. some ruby sdks must be initialized before
      // setupSdkPaths() method invocation
      sdkModificator.setSdkAdditionalData(additionalData);
    }
    if (sdkModificator.getVersionString() == null && !homePath.isEmpty()) {
      sdkModificator.setVersionString(sdkType.getVersionString(homePath));
    }
    sdkModificator.setHomePath(homePath);

    Application application = ApplicationManager.getApplication();
    Runnable runnable = () -> sdkModificator.commitChanges();
    if (application.isDispatchThread()) {
      application.runWriteAction(runnable);
    }
    else {
      application.invokeAndWait(() -> application.runWriteAction(runnable));
    }
    return sdk;
  }
@NotNull
  public static Sdk createSdk(@NotNull Collection<? extends Sdk> allSdks,
                              @NotNull String homePath,
                              @NotNull SdkType sdkType,
                              @Nullable SdkAdditionalData additionalData,
                              @Nullable String customSdkSuggestedName)