### Question:
NoOpMetricsSystem implements ObservableMetricsSystem { @Override public LabelledMetric<OperationTimer> createLabelledTimer( final MetricCategory category, final String name, final String help, final String... labelNames) { return getOperationTimerLabelledMetric(labelNames.length); }  @Override LabelledMetric<Counter> createLabelledCounter(
      final MetricCategory category,
      final String name,
      final String help,
      final String... labelNames); static LabelledMetric<Counter> getCounterLabelledMetric(final int labelCount); @Override LabelledMetric<OperationTimer> createLabelledTimer(
      final MetricCategory category,
      final String name,
      final String help,
      final String... labelNames); static LabelledMetric<OperationTimer> getOperationTimerLabelledMetric(
      final int labelCount); @Override void createGauge(
      final MetricCategory category,
      final String name,
      final String help,
      final DoubleSupplier valueSupplier); @Override Stream<Observation> streamObservations(final MetricCategory category); @Override Stream<Observation> streamObservations(); static final Counter NO_OP_COUNTER; static final OperationTimer NO_OP_OPERATION_TIMER; static final LabelledMetric<Counter> NO_OP_LABELLED_1_COUNTER; static final LabelledMetric<Counter> NO_OP_LABELLED_2_COUNTER; static final LabelledMetric<Counter> NO_OP_LABELLED_3_COUNTER; static final LabelledMetric<OperationTimer> NO_OP_LABELLED_1_OPERATION_TIMER; }### Answer:
@Test public void labelCountsMatchOnTimer() { final LabelledMetric<OperationTimer> labeledTimer = metricsSystem.createLabelledTimer(StandardMetricCategory.PROCESS, "name", "help", "label1"); assertThat(labeledTimer.labels("one")).isSameAs(NoOpMetricsSystem.NO_OP_OPERATION_TIMER); }
@Test public void failsWheLabelCountsDoNotMatchOnTimer() { final LabelledMetric<OperationTimer> labeledTimer = metricsSystem.createLabelledTimer( StandardMetricCategory.PROCESS, "name", "help", "label1", "label2"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> labeledTimer.labels("one")) .withMessage("The count of labels used must match the count of labels expected."); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> labeledTimer.labels("one", "two", "three")) .withMessage("The count of labels used must match the count of labels expected."); }