@Override
    public Set<String> getNames() {
        return unmodifiableSet(probeInstances.values().stream()
                .map(probeInstance -> probeInstance.descriptor.metricString())
                .collect(Collectors.toSet()));
    }
@Test
    public void getNames() {
        Set<String> metrics = new HashSet<>();
        metrics.add("first");
        metrics.add("second");
        metrics.add("third");

        Set<String> expected = new HashSet<>();
        expected.add("[metric=first]");
        expected.add("[metric=second]");
        expected.add("[metric=third]");

        for (String name : metrics) {
            metricsRegistry.registerStaticProbe(this, name, ProbeLevel.MANDATORY,
                    (LongProbeFunction<Object>) obj -> 0);
        }

        Set<String> names = metricsRegistry.getNames();
        for (String name : expected) {
            assertContains(names, name);
        }
    }