@Test
public void testEdgeRemoval() {
Graph graph = new Graph();
StreetVertex va = new IntersectionVertex(graph, "A", 10.0, 10.0);
StreetVertex vb = new IntersectionVertex(graph, "B", 10.1, 10.1);
StreetVertex vc = new IntersectionVertex(graph, "C", 10.2, 10.2);
StreetVertex vd = new IntersectionVertex(graph, "D", 10.3, 10.3);
Edge eab = new StreetEdge(va, vb, null, "AB", 10, StreetTraversalPermission.ALL, false);
Edge ebc = new StreetEdge(vb, vc, null, "BC", 10, StreetTraversalPermission.ALL, false);
Edge ecd = new StreetEdge(vc, vd, null, "CD", 10, StreetTraversalPermission.ALL, false);
// remove an edge that is not connected to this vertex
va.removeOutgoing(ecd);
assertEquals(va.getDegreeOut(), 1);
// remove an edge from an edgelist that is empty
vd.removeOutgoing(eab);
assertEquals(vd.getDegreeOut(), 0);
// remove an edge that is actually connected
assertEquals(va.getDegreeOut(), 1);
va.removeOutgoing(eab);
assertEquals(va.getDegreeOut(), 0);