public static boolean isInModalContextForProject(@Nullable Project project) {
    ThreadingAssertions.assertEventDispatchThread();

    if (ourModalEntities.isEmpty()) return false;
    if (project == null) return true;

    List<Dialog> modalEntitiesForProject = projectToModalEntities.get(project);
    return modalEntitiesForProject == null || modalEntitiesForProject.isEmpty();
  }
public static boolean isInModalContextForProject(@Nullable Project project)