@Override
  public void add(Component component, Metric metric, Measure measure) {
    requireNonNull(component);
    checkValueTypeConsistency(metric, measure);

    Optional<Measure> existingMeasure = find(component, metric);
    if (existingMeasure.isPresent()) {
      throw new UnsupportedOperationException(
        format(
          "a measure can be set only once for a specific Component (key=%s), Metric (key=%s). Use update method",
          component.getKey(),
          metric.getKey()));
    }
    add(component, metric, measure, OverridePolicy.OVERRIDE);
  }
@Test
  public void add_throws_NPE_if_Component_metric_is_null() {
    assertThatThrownBy(() -> underTest.add(FILE_COMPONENT, null, SOME_MEASURE))
      .isInstanceOf(NullPointerException.class);
  }