public static Predicate<MetricDto> isOptimizedForBestValue() {
    return m -> m != null && m.isOptimizedBestValue() && m.getBestValue() != null;
  }
@Test
  void isOptimizedForBestValue_is_false_when_no_best_value() {
    metric = new MetricDto()
      .setBestValue(null)
      .setOptimizedBestValue(true);

    boolean result = MetricDtoFunctions.isOptimizedForBestValue().test(metric);

    assertThat(result).isFalse();
  }