@Override
    public Map<MetricName, Metric> getMetrics() {
        final Map<MetricName, Metric> gauges = new HashMap<>();

        gauges.put(MetricName.build("name"), (Gauge<String>) runtime::getName);

        gauges.put(MetricName.build("vendor"), (Gauge<String>) () -> String.format(Locale.US,
                             "%s %s %s (%s)",
                             runtime.getVmVendor(),
                             runtime.getVmName(),
                             runtime.getVmVersion(),
                             runtime.getSpecVersion()));

        gauges.put(MetricName.build("uptime"), (Gauge<Long>) runtime::getUptime);

        return Collections.unmodifiableMap(gauges);
    }
@Test
    public void autoDiscoversTheRuntimeBean() throws Exception {
        final Gauge gauge = (Gauge) new JvmAttributeGaugeSet().getMetrics().get(MetricName.build("uptime"));

        assertThat((Long) gauge.getValue())
                .isPositive();
    }