BusLine extends AbstractBusContainer<BusNetwork, BusItinerary> { public void removeAllBusItineraries() { for (final BusItinerary itinerary : this.itineraries) { itinerary.setContainer(null); itinerary.setEventFirable(true); } this.itineraries.clear(); fireShapeChanged(new BusChangeEvent(this, BusChangeEventType.ALL_ITINERARIES_REMOVED, null, -1, "shape", null, null)); checkPrimitiveValidity(); } BusLine(BusNetwork network, String name);  BusLine(UUID id, BusNetwork network, String name);  BusLine(BusNetwork network, String name, AttributeCollection attributeProvider);  BusLine(UUID id, BusNetwork network, String name, AttributeCollection attributeProvider);  BusLine(String name);  BusLine(UUID id, String name);  BusLine(String name, AttributeCollection attributeProvider);  BusLine(UUID id, String name, AttributeCollection attributeProvider);  BusLine(BusNetwork network);  BusLine(UUID id, BusNetwork network);  BusLine(BusNetwork network, AttributeCollection attributeProvider);  BusLine(UUID id, BusNetwork network, AttributeCollection attributeProvider);  BusLine();  BusLine(UUID id);  BusLine(AttributeCollection attributeProvider);  BusLine(UUID id, AttributeCollection attributeProvider); @Override @Pure void toJson(JsonBuffer buffer); static String getFirstFreeBusLineName(BusNetwork network); @Override void rebuild(boolean fireEvents); @Override Class<? extends BusItinerary> getElementType(); @Override BusNetwork getBusNetwork(); @Override void setName(String name); @Override void resetBoundingBox(); @Override Shape2d<?> getShape(); @Pure Path2d toPath2D(); @Pure void toPath2D(Path2d path); @Override int size(); @Override Iterator<BusItinerary> iterator(); boolean addBusItinerary(BusItinerary busItinerary); boolean addBusItinerary(BusItinerary busItinerary, int index); void removeAllBusItineraries(); boolean removeBusItinerary(BusItinerary itinerary); boolean removeBusItinerary(int index); int getBusItineraryCount(); int indexOf(BusItinerary itinerary); @Override int indexInParent(); BusItinerary getBusItineraryAt(int index); BusItinerary getBusItinerary(String name); BusItinerary getBusItinerary(UUID uuid); BusItinerary getBusItinerary(String name, Comparator<String> nameComparator); Iterator<BusItinerary> busItineraryIterator(); Iterable<BusItinerary> busItineraries();  }
@Test public void testRemoveAllBusItineraries() { initTest(); assertEquals(2, this.line.getBusItineraryCount()); assertTrue(this.line.isValidPrimitive()); this.eventHandler.clear(); this.line.removeAllBusItineraries(); this.eventHandler.assertBusChangedEvent(BusChangeEventType.VALIDITY, this.line); this.eventHandler.assertBusShapeChangedEvent(BusChangeEventType.ALL_ITINERARIES_REMOVED, this.line); this.eventHandler.assertNoBusShapeAttrChangedEvent(); assertEquals(0, this.line.getBusItineraryCount()); assertFalse(this.line.isValidPrimitive()); }