class BusItinerary extends AbstractBusContainer<BusLine, BusItineraryHalt> implements RoadNetworkListener {

	@Pure
	public boolean contains(BusItineraryHalt bushalt) {
		if (bushalt == null) {
			return false;
		}
		if (bushalt.isValidPrimitive()) {
			return ListUtil.contains(this.validHalts, VALID_HALT_COMPARATOR, bushalt);
		}
		return ListUtil.contains(this.invalidHalts, INVALID_HALT_COMPARATOR, bushalt);
	}

}

class BusItineraryTest extends AbstractBusContainer<BusLine, BusItineraryHalt> {

	private final TestEventHandler eventHandler;
	private BusItinerary itinerary;
	private BusItineraryHalt halt1;
	private BusItineraryHalt halt2;
	private BusItineraryHalt halt3;
	private BusStop stop1;
	private BusStop stop2;
	private BusStop stop3;
	private StandardRoadNetwork network;
	private BusNetwork busNetwork;
	private BusLine busLine;
	private RoadPolyline segment1;
	private RoadPolyline segment2;
	private RoadPolyline segment3;

	@Test
	public void testContainsRoadSegment() {

		assertFalse(this.itinerary.contains(this.segment1));
		assertFalse(this.itinerary.contains(this.segment2));
		assertFalse(this.itinerary.contains(this.segment3));

		initTest();

		assertTrue(this.itinerary.contains(this.segment1));
		assertTrue(this.itinerary.contains(this.segment2));
		assertFalse(this.itinerary.contains(this.segment3));
	}

}