InheritedGaugeMethodBean extends GaugeMethodBean { public void setChildGauge(long childGauge) { this.childGauge = childGauge; }  @Gauge(name = "childGaugeMethod", unit = MetricUnits.NONE) long getChildGauge(); void setChildGauge(long childGauge);  }
@Test @InSequence(2) public void callGaugesAfterSetterCalls() { @SuppressWarnings("unchecked") Gauge<Long> parentGauge = (Gauge<Long>) registry.getGauge(parentMID); @SuppressWarnings("unchecked") Gauge<Long> childGauge = (Gauge<Long>) registry.getGauge(childMID); assertThat("Gauges are not registered correctly", parentGauge, notNullValue()); assertThat("Gauges are not registered correctly", childGauge, notNullValue()); long parentValue = Math.round(Math.random() * Long.MAX_VALUE); pBean.setGauge(parentValue); long childValue = Math.round(Math.random() * Long.MAX_VALUE); bean.setChildGauge(childValue); assertThat("Gauge values are incorrect", Arrays.asList(parentGauge.getValue(), childGauge.getValue()), contains(parentValue, childValue)); }