@Test
public final void testClearVehicles() {

    final double roadLength = 1000.0;
    final int laneCount = 2;
    RoadSegment.resetNextId();
    final RoadSegment roadSegment = new RoadSegment(roadLength, laneCount);
    assertEquals(0, roadSegment.getVehicleCount());
    roadSegment.addVehicle(newVehicle(900.0, 0.0, Lanes.LANE1));
    assertEquals(1, roadSegment.getVehicleCount());
    roadSegment.addVehicle(newVehicle(800.0, 0.0, Lanes.LANE2));
    assertEquals(2, roadSegment.getVehicleCount());
    roadSegment.addVehicle(newVehicle(700.0, 0.0, Lanes.LANE1));
    assertEquals(3, roadSegment.getVehicleCount());
    roadSegment.addVehicle(newVehicle(600.0, 0.0, Lanes.LANE2));
    assertEquals(4, roadSegment.getVehicleCount());
    roadSegment.clearVehicles();
    assertEquals(0, roadSegment.getVehicleCount());
    assertEquals(0, roadSegment.getVehicleCount(Lanes.LANE1));
    assertEquals(0, roadSegment.getVehicleCount(Lanes.LANE2));
}