BusStop extends AbstractBusPrimitive<BusNetwork> { public void setPosition(GeoLocationPoint position) { if ((this.position == null && position != null) || (this.position != null && !this.position.equals(position))) { this.position = position; fireShapeChanged(); checkPrimitiveValidity(); } } BusStop(String name);  BusStop(UUID id, String name);  BusStop(String name, AttributeCollection attributeProvider);  BusStop(UUID id, String name, AttributeCollection attributeProvider);  BusStop(String name, GeoLocationPoint position);  BusStop(UUID id, String name, GeoLocationPoint position);  BusStop(String name, GeoLocationPoint position, AttributeCollection attributeProvider);  BusStop(UUID id, String name, GeoLocationPoint position, AttributeCollection attributeProvider); @Override @Pure void toJson(JsonBuffer buffer); @Pure static String getFirstFreeBusStopName(BusNetwork busNetwork); @Override boolean setContainer(BusNetwork container); @Override @Pure BusNetwork getBusNetwork(); @Override void setName(String name); void setPosition(GeoLocationPoint position); @Pure GeoLocationPoint getGeoPosition(); @Pure Point2d getPosition2D(); @Override void rebuild(boolean fireEvents); @Override Shape2d<?> getShape(); @Override @Pure GeoLocation getGeoLocation(); @Pure double distance(double x, double y); @Pure double distance(BusStop stop); @Pure double distance(BusItineraryHalt halt); @Pure double distance(Point2D<?, ?> point); @Pure double distance(GeoLocationPoint point); @Pure boolean insideBusHub(); @Pure Iterable<BusHub> busHubs(); @Pure Iterator<BusHub> busHubIterator(); @Pure boolean isBusHaltBinded(); @Override @Pure int indexInParent(); @Pure Iterable<BusItineraryHalt> getBindedBusHalts();  }
@Test public void testIsValidPrimitive() { assertFalse(this.stop.isValidPrimitive()); this.eventHandler.clear(); this.stop.setPosition(new GeoLocationPoint(34., 35.)); assertTrue(this.stop.isValidPrimitive()); this.eventHandler.assertBusChangedEvent(BusChangeEventType.VALIDITY, this.stop); this.eventHandler.assertBusShapeChangedEvent(BusChangeEventType.STOP_CHANGED, this.stop); this.eventHandler.assertNoBusShapeAttrChangedEvent(); }