@Test
public void shouldHandleMBeanAttributeOtherException() throws Exception {

    // given
    GaugeConfig gaugeConfig = ImmutableGaugeConfig.builder()
            .mbeanObjectName("xyz:aaa=bbb")
            .addMbeanAttributes(ImmutableMBeanAttribute.of("ccc", false))
            .addMbeanAttributes(ImmutableMBeanAttribute.of("ddd", false))
            .build();
    when(lazyPlatformMBeanServer.getAttribute(any(ObjectName.class), anyString(),
            anyMBeanServerList())).thenThrow(new RuntimeException("A msg"));
    // when
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    collectGaugeValues(gaugeConfig);
    // then
    verify(logger, times(10)).debug(anyString(), any(Exception.class));
    verify(logger).warn(eq("error accessing mbean attribute: {} {}"), eq("xyz:aaa=bbb"),
            eq("ccc"), any(RuntimeException.class));
    verify(logger).warn(eq("error accessing mbean attribute: {} {}"), eq("xyz:aaa=bbb"),
            eq("ddd"), any(RuntimeException.class));
}