@Test public void shouldResultBeCorrect() { final LastConsolidator consolidator = new LastConsolidator(); consolidator.accumulate(2L, 2); consolidator.accumulate(1L, 1); consolidator.accumulate(4L, 4); consolidator.accumulate(3L, 3); Assert.assertEquals(4, consolidator.consolidateAndReset()); }
@Override public void accumulate(final long timestamp, final int value) { if (timestamp > this.timestamp) { setCurrentResult(value); this.timestamp = timestamp; } }
LastConsolidator extends BaseStreamingConsolidator { @Override public void accumulate(final long timestamp, final int value) { if (timestamp > this.timestamp) { setCurrentResult(value); this.timestamp = timestamp; } } }
LastConsolidator extends BaseStreamingConsolidator { @Override public void accumulate(final long timestamp, final int value) { if (timestamp > this.timestamp) { setCurrentResult(value); this.timestamp = timestamp; } }  }
LastConsolidator extends BaseStreamingConsolidator { @Override public void accumulate(final long timestamp, final int value) { if (timestamp > this.timestamp) { setCurrentResult(value); this.timestamp = timestamp; } }  @Override void accumulate(final long timestamp, final int value); }
LastConsolidator extends BaseStreamingConsolidator { @Override public void accumulate(final long timestamp, final int value) { if (timestamp > this.timestamp) { setCurrentResult(value); this.timestamp = timestamp; } }  @Override void accumulate(final long timestamp, final int value);  }