code: private void calculateHighestAlert() {
          synchronized (alerts) {
              highestAlert = null;
              for (Alert alert : alerts) {
                  if (isHighestAlert(alert)) {
                      highestAlert = alert;
                  }
              }
              calculateHighestAlert = false;
          }
      }
docs: Calculates the highest alert.
  <p>
  After a call to this method the {@link #highestAlert} will have the highest alert (or {@code null} if none) and the flag
  {@link #calculateHighestAlert} will have the value {@code false}.
  
  @see #isHighestAlert(Alert)