BusHub extends AbstractBusPrimitive<BusNetwork> implements Iterable<BusStop> { @Pure public int getBusStopCount() { return this.busStops.size(); } BusHub(BusNetwork network, String name);   BusHub(BusNetwork network, String name, AttributeCollection attributeProvider); @Pure static String getFirstFreeBusHubName(BusNetwork busnetwork); @Override void rebuild(boolean fireEvents); @Override @Pure GeoLocation getGeoLocation(); @Pure GeoLocationPoint getGeoPosition(); @Pure Point2d getPosition2D(); @Override @Pure BusNetwork getBusNetwork(); @Override @Pure void toJson(JsonBuffer buffer); @Override @Pure String getName(); @Override Shape2d<?> getShape(); @Pure boolean isEmpty(); @Override @Pure int indexInParent(); @Pure boolean isSignificant(); @Pure double distance(double x, double y); @Pure double distance(Point2D<?, ?> point); @Pure final double distance(GeoLocationPoint point); boolean addBusStop(BusStop busStop); void removeAllBusStops(); boolean removeBusStop(BusStop busStop); boolean removeBusStop(int index); @Pure int getBusStopCount(); @Pure int indexOf(BusStop busStop); @Pure boolean contains(BusStop busStop); @Pure BusStop getBusStopAt(int index); @Pure Iterator<BusStop> busStopIterator(); @Pure Iterable<BusStop> busStops(); @Pure BusStop[] busStopsArray(); @Override @Pure Iterator<BusStop> iterator();  }
@Test public void testGetBusStopCount() { assertEquals(0, this.hub.getBusStopCount()); assertTrue(this.hub.addBusStop(new BusStopStub(this.busNetwork, "STOP1"))); assertTrue(this.hub.addBusStop(new BusStopStub(this.busNetwork, "STOP2"))); assertEquals(2, this.hub.getBusStopCount()); assertTrue(this.hub.removeBusStop(0)); assertEquals(1, this.hub.getBusStopCount()); assertFalse(this.hub.removeBusStop(1)); assertEquals(1, this.hub.getBusStopCount()); assertTrue(this.hub.removeBusStop(0)); assertEquals(0, this.hub.getBusStopCount()); }