@NotNull
  static FormattingNotificationService getInstance(@NotNull Project project) {
    if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
      return HeadlessNotificationService.INSTANCE;
    }
    else {
      return project.getService(FormattingNotificationService.class);
    }
  }
@NotNull
  static FormattingNotificationService getInstance(@NotNull Project project)