@Test
    public void testDuplicateMetricName() {
        metrics.sensor("test").add(metrics.metricName("test", "grp1"), new Avg());
        assertThrows(IllegalArgumentException.class, () ->
                metrics.sensor("test2").add(metrics.metricName("test", "grp1"), new CumulativeSum()));
    }
Some implementations of SampledStat make sense to return the initial value
when there are no values set
clients/src/test/java/org/apache/kafka/common/metrics/MetricsTest.java