@Test
public void testMerge() {

  BinningAggregation<Persistable, Long, CommonIndexedPersistenceEncoding> agg =
      new BinningAggregation<>(new CountAggregation(), randomBinStrategy, -1);
  Map<String, Long> res1 = ImmutableMap.of("0", 3L, "1", 2L);
  Map<String, Long> res2 = ImmutableMap.of("0", 2L, "1", 3L);
  // relies on CountAggregation#merge, which adds the values.
  Map<String, Long> merged = agg.merge(res1, res2);
  assertThat(merged.get("0"), is(5L));
  assertThat(merged.get("1"), is(5L));
}