@SuppressWarnings("boxing")
@Test
public final void testIterator() {

    // fail("Not yet implemented");
    RoadSegment.resetNextId();
    Vehicle.resetNextId();
    final int laneCount = 3;
    final RoadSegment r0 = new RoadSegment(1000.0, laneCount);
    final Vehicle v0 = newVehicle(800.0, 1.0, Lanes.LANE2);
    r0.addVehicle(v0);
    final Vehicle v1 = newVehicle(700.0, 1.0, Lanes.LANE3);
    r0.addVehicle(v1);
    final Vehicle v2 = newVehicle(600.0, 1.0, Lanes.LANE3);
    r0.addVehicle(v2);
    final Iterator<Vehicle> iterator = r0.iterator();
    assertEquals(true, iterator.hasNext());
    assertEquals(v0, iterator.next());
    assertEquals(true, iterator.hasNext());
    assertEquals(v1, iterator.next());
    assertEquals(true, iterator.hasNext());
    assertEquals(v2, iterator.next());
    assertEquals(false, iterator.hasNext());
}