@Override
  public Long aggregate(final Object currentValue, final Long aggregateValue) {
    if (currentValue == null) {
      return aggregateValue;
    }
    return aggregateValue + 1;
  }
@Test
  public void shouldHandleNullCount() {
    final CountKudaf doubleCountKudaf = getDoubleCountKudaf();
    final double[] values = new double[]{3.0, 5.0, 8.0, 2.2, 3.5, 4.6, 5.0};
    Long currentCount = 0L;

    // aggregate null before any aggregation
    currentCount = doubleCountKudaf.aggregate(null, currentCount);
    assertThat(0L, equalTo(currentCount));

    // now send each value to aggregation and verify
    for (final double i: values) {
      currentCount = doubleCountKudaf.aggregate(i, currentCount);
    }
    assertThat(7L, equalTo(currentCount));

    // null should not affect count
    currentCount = doubleCountKudaf.aggregate(null, currentCount);
    assertThat(7L, equalTo(currentCount));
  }