@Test
public void mergeItem() throws Exception {

    Aggregation aggregation1 = aggregations.get(0);
    Aggregation aggregation2 = aggregations.get(1);
    Item aggregation1_item = itemMapper.fromByteBuffer(serialize(aggregation1));
    Item aggregation2_item = itemMapper.fromByteBuffer(serialize(aggregation2));
    Item resultItem = itemMapper.mergeItem(itemMapper.primaryKey(aggregation1_item), aggregation1_item, aggregation2_item);
    assertEquals(itemMapper.primaryKey(aggregation2_item), itemMapper.primaryKey(resultItem));
    assertEquals(aggregation1.getClicks() + aggregation2.getClicks(), resultItem.getLong("clicks"));
    assertEquals(aggregation1.getBids() + aggregation2.getBids(), resultItem.getLong("bids"));
    assertEquals(aggregation1.getImps() + aggregation2.getImps(), resultItem.getLong("imps"));
}