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

        assertThat(gauge.getValue()).isNull();
    }