@Test
public void testPlanEdgeInsert() {
SillyPlan plan = new SillyPlan();
SillyOperator fred = new SillyOperator("fred", plan);
SillyOperator joe = new SillyOperator("joe", plan);
PlanEdge edges = new PlanEdge();
// Test initial entry
edges.put(fred, joe, 0);
Collection<Operator> c = edges.get(fred);
assertEquals(1, c.size());
Operator[] a = new Operator[1];
Operator[] b = c.toArray(a);
assertEquals(joe, b[0]);
// Test entry with no position
SillyOperator bob = new SillyOperator("bob", plan);
edges.put(fred, bob);
c = edges.get(fred);
assertEquals(2, c.size());
a = new Operator[2];
b = c.toArray(a);
assertEquals(joe, b[0]);
assertEquals(bob, b[1]);
// Test entry with position
SillyOperator jill = new SillyOperator("jill", plan);
edges.put(fred, jill, 1);
c = edges.get(fred);
assertEquals(3, c.size());
a = new Operator[3];
b = c.toArray(a);
assertEquals(joe, b[0]);
assertEquals(jill, b[1]);