@Test
public void testInvert() {

	Iterator<BusItineraryHalt> iterator;
	Iterator<RoadSegment> iterator2;
	initTest();
	this.eventHandler.clear();
	this.itinerary.invert();
	iterator = this.itinerary.iterator();
	assertTrue(iterator.hasNext());
	assertSame(this.halt2, iterator.next());
	assertTrue(iterator.hasNext());
	assertSame(this.halt1, iterator.next());
	assertFalse(iterator.hasNext());
	iterator2 = this.itinerary.roadSegmentsIterator();
	assertTrue(iterator2.hasNext());
	assertSame(this.segment2, iterator2.next());
	assertTrue(iterator2.hasNext());
	assertSame(this.segment1, iterator2.next());
	assertFalse(iterator2.hasNext());
	this.eventHandler.assertNoBusChangedEvent();
	this.eventHandler.assertBusShapeChangedEvent(BusChangeEventType.ITINERARY_INVERTED, this.itinerary);
	this.eventHandler.assertNoBusShapeAttrChangedEvent();
	this.eventHandler.clear();
	this.itinerary.invert();
	iterator = this.itinerary.iterator();
	assertTrue(iterator.hasNext());
	assertSame(this.halt1, iterator.next());
	assertTrue(iterator.hasNext());
	assertSame(this.halt2, iterator.next());
	assertFalse(iterator.hasNext());
	iterator2 = this.itinerary.roadSegmentsIterator();
	assertTrue(iterator2.hasNext());
	assertSame(this.segment1, iterator2.next());
	assertTrue(iterator2.hasNext());
	assertSame(this.segment2, iterator2.next());
	assertFalse(iterator2.hasNext());
	this.eventHandler.assertNoBusChangedEvent();
	this.eventHandler.assertBusShapeChangedEvent(BusChangeEventType.ITINERARY_INVERTED, this.itinerary);
	this.eventHandler.assertNoBusShapeAttrChangedEvent();
}