private static void closeProject(@NotNull Project project) {
    ApplicationManager.getApplication().invokeAndWait(() -> {
      if (!project.isDisposed()) {
        if (Boolean.getBoolean("inspect.save.project.settings")) {
          forPoorJavaClientOnlySaveProjectIndEdtDoNotUseThisMethod(project, true);
        }
        ProjectManagerEx.getInstanceEx().forceCloseProject(project);
      }
    });
  }
private static void closeProject(@NotNull Project project)