AccuracyAggregator implements CombinerAggregator<AccuracyState<L>> { @Override public AccuracyState<L> combine(AccuracyState<L> val1, AccuracyState<L> val2) { return new AccuracyState<L>(val1.totalCount + val2.totalCount, val1.errorCount + val2.errorCount); }  @Override AccuracyState<L> init(TridentTuple tuple); @Override AccuracyState<L> combine(AccuracyState<L> val1, AccuracyState<L> val2); @Override AccuracyState<L> zero();  }
@Test public void should_combine_accuracy() { AccuracyState<Boolean> first = new AccuracyState<Boolean>(10, 3); AccuracyState<Boolean> second = new AccuracyState<Boolean>(15, 13); AccuracyState<Boolean> combined = agrgegator.combine(first, second); assertThat(combined).isEqualTo(new AccuracyState<Boolean>(25, 16)); }