@Override
    public Object getValue() {
        try {
            return mBeanServerConn.getAttribute(getObjectName(), attributeName);
        } catch (IOException | JMException e) {
            return null;
        }
    }
@Test
    public void returnsJmxAttribute() throws Exception {
        ObjectName objectName = new ObjectName("java.lang:type=ClassLoading");
        JmxAttributeGauge gauge = new JmxAttributeGauge(mBeanServer, objectName, "LoadedClassCount");

        assertThat(gauge.getValue()).isInstanceOf(Integer.class);
        assertThat((Integer) gauge.getValue()).isGreaterThan(0);
    }