//Test normal edge
graph.addEdge(node1, node2);
AbstractNode AbstractNode1 = (AbstractNode) node1;
AbstractNode AbstractNode2 = (AbstractNode) node2;
AbstractEdge edge = AbstractNode1.getEdgesOutTree().getItem(AbstractNode2.getNumber());
assertNotNull("find OUT edge", edge);
assertTrue("contains OUT edge", AbstractNode1.getEdgesOutTree().contains(edge));
AbstractEdge edge2 = AbstractNode2.getEdgesInTree().getItem(AbstractNode1.getNumber());
assertNotNull("find IN edge", edge);
assertTrue("contains IN edge", AbstractNode2.getEdgesInTree().contains(edge2));
assertSame("edges equal", edge, edge2);
assertEquals("edges count", 1, graph.getEdgeCount());
//Test factoryedge
graph.addEdge(edge);
assertEquals("edges count", 1, graph.getEdgeCount());
//Test self loop
graph.addEdge(node3, node3);
AbstractNode AbstractNode3 = (AbstractNode) node3;
AbstractEdge edge3 = AbstractNode3.getEdgesOutTree().getItem(AbstractNode3.getNumber());
assertNotNull("find OUT edge", edge);
assertTrue("contains OUT edge", AbstractNode3.getEdgesOutTree().contains(edge3));
AbstractEdge edge4 = AbstractNode3.getEdgesInTree().getItem(AbstractNode3.getNumber());
assertNotNull("find IN edge", edge);
assertTrue("contains IN edge", AbstractNode3.getEdgesInTree().contains(edge3));
assertSame("edges equal", edge3, edge4);