public void testMerge_collectionAndElement_unmergeableElements() {
String id1 = "13458";
String id2 = "abcdef";
long duration1 = 139834;
long duration2 = 983471;
PartEventType type1 = new PartEventType();
PartEventType type2 = new PartEventType();
type1.setDuration(duration1);
type2.setDuration(duration2);
type1.setPartId(id1);
type2.setPartId(id2);
IMerger<PartEventType> merger = new PartEventTypeMerger();
// Check the elements we just created are not mergeable
assertFalse(merger.isMergeable(type1, type2));
List<PartEventType> collection = Lists.newArrayList(type1);
assertSame(collection, Mergers.merge(merger, collection, type2));
// Check the elements are merged:
assertEquals(2, collection.size());
assertSame(type1, collection.get(0));
assertSame(type2, collection.get(1));
assertEquals(id1, type1.getPartId());
assertEquals(id2, type2.getPartId());
assertEquals(duration1, type1.getDuration());
assertEquals(duration2, type2.getDuration());
}