void (@NotNull Notification notification, @Nullable Project project) { notification.assertHasTitleOrContent(); Application app = ApplicationManager.getApplication(); if (app.isUnitTestMode() || app.isDispatchThread()) { doNotify(notification, project); } else if (project == null) { app.invokeLater(() -> doNotify(notification, null)); } else { app.invokeLater(() -> doNotify(notification, project), project.getDisposed()); } }