g.addNode("4");
g.addNode("5");
try {
A goodTypedEdge = g.addEdge("e0", "0", "1");
Edge e = g.addEdge("e1", "1", "2");
} catch (ClassCastException e) {
fail();
}
try {
BadTypedEdge bte = g.addEdge("e2", "2", "3");
fail();
} catch (ClassCastException e) {
}
assertNotNull(g.getEdge("e0"));
assertNotNull(g.getEdge("e1"));
assertNotNull(g.getEdge("e2"));
// Get
try {
A goodTypedEdge;
goodTypedEdge = g.getEdge("e0");
goodTypedEdge = g.getEdge("e1");
goodTypedEdge = g.getEdge("e2");
Edge e;
e = g.getEdge("e0");
e = g.getEdge("e1");
e = g.getEdge("e2");
} catch (ClassCastException e) {
fail();
}
try {
BadTypedEdge bte;
bte = g.getEdge("e0");
fail();
bte = g.getEdge("e1");
fail();
bte = g.getEdge("e2");
fail();
} catch (ClassCastException e) {
}
// Remove
try {
A goodTypedEdge = g.removeEdge("e0");
Edge e = g.removeEdge("e1");
} catch (ClassCastException e) {
fail();
}
try {