### Question:
EventMetric extends AbstractMetric<Distribution> { public void record(double sample, String... labelValues) { MetricsUtils.checkLabelValuesLength(this, labelValues); recordMultiple(sample, 1, Instant.now(), ImmutableList.copyOf(labelValues)); } EventMetric(
      String name,
      String description,
      String valueDisplayName,
      DistributionFitter distributionFitter,
      ImmutableSet<LabelDescriptor> labels); @Override final int getCardinality(); @Override final ImmutableList<MetricPoint<Distribution>> getTimestampedValues(); void record(double sample, String... labelValues); void record(double sample, int count, String... labelValues); void reset(); void reset(String... labelValues); static final DistributionFitter DEFAULT_FITTER; }### Answer:
@Test public void testIncrementBy_wrongLabelValueCount_throwsException() { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> metric.record(1.0, "blah", "blah")); assertThat(thrown) .hasMessageThat() .contains( "The count of labelValues must be equal to the underlying Metric's count of labels."); }