@Test
public void testAggregate() {

  BinningAggregation<Persistable, Long, CommonIndexedPersistenceEncoding> agg =
      new BinningAggregation<>(new CountAggregation(), randomBinStrategy, -1);
  agg.aggregate(null);
  Map<String, Long> result = agg.getResult();
  assertThat(result.size(), is(1));
  agg.aggregate(null);
  result = agg.getResult();
  assertThat(result.size(), is(2));
  agg.clearResult();
  agg.aggregate(null);
  result = agg.getResult();
  assertThat(result.size(), is(1));
}