@Test public void shouldResultBeCorrect() { final MeanConsolidator consolidator = new MeanConsolidator(); consolidator.accumulate(2L, 2); consolidator.accumulate(1L, 1); consolidator.accumulate(4L, 4); consolidator.accumulate(3L, 3); consolidator.accumulate(5L, 5); Assert.assertEquals(3, consolidator.consolidateAndReset()); }
@Override public void accumulate(final long timestamp, final int value) { this.sum += value; ++this.count; }
MeanConsolidator extends Consolidator { @Override public void accumulate(final long timestamp, final int value) { this.sum += value; ++this.count; } }
MeanConsolidator extends Consolidator { @Override public void accumulate(final long timestamp, final int value) { this.sum += value; ++this.count; }  }
MeanConsolidator extends Consolidator { @Override public void accumulate(final long timestamp, final int value) { this.sum += value; ++this.count; }  @Override void accumulate(final long timestamp, final int value); @Override int consolidate(); }
MeanConsolidator extends Consolidator { @Override public void accumulate(final long timestamp, final int value) { this.sum += value; ++this.count; }  @Override void accumulate(final long timestamp, final int value); @Override int consolidate();  }