public void testDefaultEdgePathOrientation() { Graph g = new PrimaryGraph(); Node n1 = g.newNode(); Node n2 = g.newNode(); Edge e = g.newEdge(n1, n2); Path p = e.asPath(); assertEquals(n1, p.headNode()); assertEquals(n2, p.tailNode()); }
public void testNegativeIndexInSingleEdge() { Graph g = new PrimaryGraph(); Edge e = g.newEdge(g.newNode(), g.newNode()); assertSame(e.n2(), e.asPath().getNode(-1)); assertSame(e.n1(), e.asPath().getNode(-2)); }