public static @Nullable NotificationType getDominatingType(@NotNull Collection<? extends Notification> notifications) {
    NotificationType result = null;
    for (Notification notification : notifications) {
      NotificationType type = notification.getType();
      if (ERROR == type) return ERROR;
      else if (WARNING == type) result = WARNING;
      else if (result == null) result = INFORMATION;
    }
    return result;
  }
public static @Nullable NotificationType getDominatingType(@NotNull Collection<? extends Notification> notifications)