*
* @throws Exception if something goes wrong
*/
@Test
public void testBothHaveBounds() throws Exception {
Bound bound0 = new Bound(1, 2, 4, 3, "source1");
RunnableSource source0 = new BoundSource(bound0, true);
Bound bound1 = new Bound(5, 6, 8, 7, "source2");
RunnableSource source1 = new BoundSource(bound1, true);
EntityMerger merger = new EntityMerger(ConflictResolutionMethod.LatestSource, 1,
BoundRemovedAction.Ignore);
SinkEntityInspector merged = RunTaskUtilities.run(merger, source0, source1);
List<EntityContainer> mergedList = createList(merged.getProcessedEntities());
Assert.assertEquals(3, mergedList.size());
Assert.assertEquals(EntityType.Bound, mergedList.get(0).getEntity().getType());
// Check the bound
Bound bound01 = (Bound) mergedList.get(0).getEntity();
Assert.assertEquals(bound0.union(bound1), bound01);
for (int i = 1; i < mergedList.size(); i++) {
Assert.assertEquals(EntityType.Node, mergedList.get(i).getEntity().getType());
}