@Override
  public EvaluatedQualityGate evaluate(QualityGate gate, Measures measures, Configuration configuration) {
    EvaluatedQualityGate.Builder result = EvaluatedQualityGate.newBuilder()
      .setQualityGate(gate);

    boolean ignoreSmallChanges = configuration.getBoolean(CoreProperties.QUALITY_GATE_IGNORE_SMALL_CHANGES).orElse(true);
    boolean isSmallChangeset = ignoreSmallChanges && isSmallChangeset(measures);

    gate.getConditions().forEach(condition -> {
      String metricKey = condition.getMetricKey();
      EvaluatedCondition evaluation = ConditionEvaluator.evaluate(condition, measures);

      if (isSmallChangeset && evaluation.getStatus() != EvaluationStatus.OK && METRICS_TO_IGNORE_ON_SMALL_CHANGESETS.contains(metricKey)) {
        result.addEvaluatedCondition(new EvaluatedCondition(evaluation.getCondition(), EvaluationStatus.OK, evaluation.getValue().orElse(null)));
        result.setIgnoredConditionsOnSmallChangeset(true);
      } else {
        result.addEvaluatedCondition(evaluation);
      }
    });

    result.setStatus(overallStatusOf(result.getEvaluatedConditions()));

    return result.build();
  }
@Test
  public void evaluate_is_ERROR() {
    Condition condition = new Condition(NEW_MAINTAINABILITY_RATING_KEY, Condition.Operator.GREATER_THAN, "0");

    QualityGate gate = mock(QualityGate.class);
    when(gate.getConditions()).thenReturn(singleton(condition));
    QualityGateEvaluator.Measures measures = key -> Optional.of(new FakeMeasure(1));

    assertThat(underTest.evaluate(gate, measures, configuration).getStatus()).isEqualTo(Metric.Level.ERROR);
  }