### Question:
IntersectionVertex extends StreetVertex { public boolean inferredFreeFlowing() { if (this.freeFlowing) { return true; } return getDegreeIn() == 1 && getDegreeOut() == 1 && !this.trafficLight; } IntersectionVertex(Graph g, String label, double x, double y, String name);  IntersectionVertex(Graph g, String label, double x, double y); boolean inferredFreeFlowing();  }### Answer:
@Test public void testInferredFreeFlowing() { IntersectionVertex iv = new IntersectionVertex(_graph, "vertex", 1.0, 2.0); assertFalse(iv.isTrafficLight()); assertFalse(iv.inferredFreeFlowing()); assertEquals(0, iv.getDegreeIn()); assertEquals(0, iv.getDegreeOut()); iv.setTrafficLight(true); assertTrue(iv.isTrafficLight()); assertFalse(iv.inferredFreeFlowing()); iv.addIncoming(fromEdge); assertEquals(1, iv.getDegreeIn()); assertEquals(0, iv.getDegreeOut()); assertFalse(iv.inferredFreeFlowing()); iv.addOutgoing(straightAheadEdge); assertEquals(1, iv.getDegreeIn()); assertEquals(1, iv.getDegreeOut()); assertFalse(iv.inferredFreeFlowing()); iv.setTrafficLight(false); assertFalse(iv.isTrafficLight()); assertTrue(iv.inferredFreeFlowing()); iv.setFreeFlowing(false); assertFalse(iv.isFreeFlowing()); }