DoubleStatisticBinding implements StatisticBinding { @Override public double doubleValue() { return statistics.getDouble(statId); } DoubleStatisticBinding(Statistics statistics, int statId); @Override void add(double amount); @Override double doubleValue(); @Override long longValue();  }
@Test public void doubleValue_returnsDoubleStatValue() { int statId = 27; StatisticBinding binding = new DoubleStatisticBinding(statistics, statId); when(statistics.getDouble(statId)).thenReturn(2341.9); assertThat(binding.doubleValue()) .isEqualTo(2341.9); }