Merge entity, with test