@Override
  public QualityGate.Condition apply(Condition input) {
    String metricKey = input.getMetric().getKey();
    ConditionStatus conditionStatus = statusPerConditions.get(input);
    checkState(conditionStatus != null, "Missing ConditionStatus for condition on metric key %s", metricKey);
    return builder
      .setStatus(convert(conditionStatus.getStatus()))
      .setMetricKey(metricKey)
      .setOperator(convert(input.getOperator()))
      .setErrorThreshold(input.getErrorThreshold())
      .setValue(conditionStatus.getValue())
      .build();
  }
@Test
  public void apply_converts_key_from_metric() {
    ConditionToCondition underTest = new ConditionToCondition(of(SOME_CONDITION, SOME_CONDITION_STATUS));

    assertThat(underTest.apply(SOME_CONDITION).getMetricKey()).isEqualTo(METRIC_KEY);
  }