}
return evaluateCondition(condition, measureComparable, Measure.Level.ERROR)
- .orElse(evaluateCondition(condition, measureComparable, Measure.Level.WARN)
- .orElse(new EvaluationResult(Measure.Level.OK, measureComparable)));
+ .orElseGet(() -> evaluateCondition(condition, measureComparable, Measure.Level.WARN)
+ .orElseGet(() -> new EvaluationResult(Measure.Level.OK, measureComparable)));
}
private static Optional<EvaluationResult> evaluateCondition(Condition condition, Comparable<?> measureComparable, Measure.Level alertLevel) {