private void collectConsent(@Nullable Project project) {
    final String description = ProjectBundle.message("dialog.sdk.download.message", ApplicationInfo.getInstance().getFullApplicationName(), getDownloadDescription());
    final String lookupReason = getSdkLookupReason();

    final var dialog = MessageDialogBuilder
      .yesNo(
        ProjectBundle.message("dialog.sdk.download.title"),
        lookupReason != null ? ProjectBundle.message("dialog.sdk.download.message.with.reason", lookupReason, description) : description
      )
      .yesText(ProjectBundle.message("dialog.sdk.download.yes"));

    try {
      SwingUtilities.invokeAndWait(() -> {
        if (dialog.ask(project)) {
          giveConsent();
        }
      });
    }
    catch (InterruptedException | InvocationTargetException e) {
      LOG.warn("Failed to get SDK download consent", e);
    }
  }
private void collectConsent(@Nullable Project project)