@Test
public void mergeItems() {

    Map<PrimaryKey, Item> merged = itemMapper.mergeItems(
            aggregations.stream()
                    .map(this::serialize)
                    .collect(Collectors.toList())
    );
    assertEquals(1, merged.size());
    Item mergedItem = merged.values().iterator().next();
    Aggregation aggregation1 = aggregations.get(0);
    Aggregation aggregation2 = aggregations.get(1);
    assertEquals(aggregation1.getClicks() + aggregation2.getClicks(), mergedItem.getLong("clicks"));
    assertEquals(aggregation1.getBids() + aggregation2.getBids(), mergedItem.getLong("bids"));
    assertEquals(aggregation1.getImps() + aggregation2.getImps(), mergedItem.getLong("imps"));
}