Gauge { public void sample(double x) { sample(x, defaultPosition); } Gauge(String name, Point defaultPosition, MetricReceiver receiver); void sample(double x); void sample(double x, Point p); PointBuilder builder();  }
@Test public final void testSampleDouble() throws InterruptedException { final String metricName = "unitTestGauge"; Gauge g = receiver.declareGauge(metricName); g.sample(1.0d); Bucket b = receiver.getSnapshot(); final Map<String, List<Entry<Point, UntypedMetric>>> valuesByMetricName = b.getValuesByMetricName(); assertEquals(1, valuesByMetricName.size()); List<Entry<Point, UntypedMetric>> x = valuesByMetricName.get(metricName); assertEquals(1, x.size()); assertEquals(Point.emptyPoint(), x.get(0).getKey()); assertEquals(1L, x.get(0).getValue().getCount()); assertEquals(1.0d, x.get(0).getValue().getLast(), 0.0d); }