SumDistinctPRQueryNode extends DistinctAggregator { @Override public void accumulate(Object value) { if (value != null && value != QueryService.UNDEFINED) { this.distinct.addAll((Set) value); } }  @Override void accumulate(Object value); @Override Object terminate();  }
@Test public void accumulateShouldComputeIntermediateAdditions() { distinctAggregator.accumulate(new HashSet<>()); assertThat(distinctAggregator.getDistinct()).isEmpty(); distinctAggregator.accumulate(new HashSet<>(Arrays.asList(1, 10.12f))); assertThat(distinctAggregator.getDistinct()).isNotEmpty().hasSize(2); distinctAggregator.accumulate(new HashSet<>(Collections.singletonList(10.12f))); assertThat(distinctAggregator.getDistinct()).isNotEmpty().hasSize(2); }