### Question:
Counter extends AbstractMetric<Long> implements SettableMetric<Long>, IncrementableMetric { @Override public final void increment(String... labelValues) { MetricsUtils.checkLabelValuesLength(this, labelValues); incrementBy(1L, Instant.now(), ImmutableList.copyOf(labelValues)); } Counter(
      String name,
      String description,
      String valueDisplayName,
      ImmutableSet<LabelDescriptor> labels); @Override final void incrementBy(long offset, String... labelValues); @Override final void increment(String... labelValues); @Override final ImmutableList<MetricPoint<Long>> getTimestampedValues(); @Override final int getCardinality(); @Override final void set(Long value, String... labelValues); @Override final void reset(); @Override final void reset(String... labelValues);  }### Answer:
@Test public void testIncrementBy_wrongLabelValueCount_throwsException() { Counter counter = new Counter( "/metric", "description", "vdn", ImmutableSet.of( LabelDescriptor.create("label1", "bar"), LabelDescriptor.create("label2", "bar"))); IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> counter.increment("blah")); assertThat(thrown) .hasMessageThat() .contains( "The count of labelValues must be equal to the underlying Metric's count of labels."); }