MaxGauge extends AbstractMonitor<Long> implements Gauge<Long>, SpectatorMonitor { public void update(long v) { spectatorGauge.set(v); for (int i = 0; i < Pollers.NUM_POLLERS; ++i) { updateMax(i, v); } } MaxGauge(MonitorConfig config);   MaxGauge(MonitorConfig config, Clock clock); void update(long v); @Override Long getValue(int nth); long getCurrentValue(int nth); @Override void initializeSpectator(TagList tags); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testUpdate() throws Exception { clock.set(0L); MaxGauge maxGauge = newInstance("max1"); maxGauge.update(42L); assertEquals(maxGauge.getValue().longValue(), 0L); clock.set(60000L); assertEquals(maxGauge.getValue().longValue(), 42L); }