@Override
    public boolean emitMetric(SinglePointMetric metric) {
        if (!shouldEmitMetric(metric)) {
            return false;
        }

        emitted.add(metric);
        return true;
    }
@Test
    public void testEmitMetric() {
        Predicate<? super MetricKeyable> selector = ClientTelemetryUtils.getSelectorFromRequestedMetrics(
            Collections.singletonList("name"));
        ClientTelemetryEmitter emitter = new ClientTelemetryEmitter(selector, true);

        SinglePointMetric gauge = SinglePointMetric.gauge(metricKey, Long.valueOf(1), now, Collections.emptySet());
        SinglePointMetric sum = SinglePointMetric.sum(metricKey, 1.0, true, now, Collections.emptySet());
        assertTrue(emitter.emitMetric(gauge));
        assertTrue(emitter.emitMetric(sum));

        MetricKey anotherKey = new MetricKey("io.name", Collections.emptyMap());
        assertFalse(emitter.emitMetric(SinglePointMetric.gauge(anotherKey, Long.valueOf(1), now, Collections.emptySet())));

        assertEquals(2, emitter.emittedMetrics().size());
        assertEquals(Arrays.asList(gauge, sum), emitter.emittedMetrics());
    }