@Override
    public Map<String, Metric> getMetrics() {
        final Map<String, Metric> gauges = new HashMap<>();
        gauges.put("loaded", (Gauge<Long>) mxBean::getTotalLoadedClassCount);
        gauges.put("unloaded", (Gauge<Long>) mxBean::getUnloadedClassCount);

        return gauges;
    }
@Test
    public void unLoadedGauge() {
        final Gauge gauge = (Gauge) gauges.getMetrics().get("unloaded");
        assertThat(gauge.getValue()).isEqualTo(1L);
    }