code: private static Alert combine_alert_with_past_(Alert alert, Map<GroupName, Alert> previous) {
          Alert result = Optional.ofNullable(previous.get(alert.getName()))
                  .map((prev) -> prev.extend(alert))
                  .orElse(alert);
          logger.log(Level.FINE, "emitting alert {0} -> {1}", new Object[]{result.getName(), result.getAlertState().name()});
          return result;
      }
docs: Combine a new alert with its previous state.
  
  @param alert An emitted alert.
  @param previous A map with alerts during the previous cycle.
  @return An alert that its predecessor extended.