@Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Condition condition = (Condition) o;
    return Objects.equals(metricKey, condition.metricKey) &&
      operator == condition.operator &&
      Objects.equals(errorThreshold, condition.errorThreshold);
  }
@Test
  public void equals_is_based_on_all_fields() {
    assertThat(underTest)
      .isEqualTo(underTest)
      .isNotNull()
      .isNotEqualTo(new Object())
      .isEqualTo(new Condition(METRIC_KEY, OPERATOR, ERROR_THRESHOLD))
      .isNotEqualTo(new Condition("other_metric_key", OPERATOR, ERROR_THRESHOLD));
    Arrays.stream(Condition.Operator.values())
      .filter(s -> !OPERATOR.equals(s))
      .forEach(otherOperator -> assertThat(underTest)
        .isNotEqualTo(new Condition(METRIC_KEY, otherOperator, ERROR_THRESHOLD)));
    assertThat(underTest).isNotEqualTo(new Condition(METRIC_KEY, OPERATOR, "other_error_threshold"));
  }