@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 hasAGaugeForTheJVMUptime() throws Exception {
        final Gauge gauge = (Gauge) gauges.getMetrics().get(MetricName.build("uptime"));

        assertThat(gauge.getValue())
                .isEqualTo(100L);
    }