### Question:
BusItineraryHalt extends AbstractBusPrimitive<BusItinerary> { @Override @Pure public final GeoLocation getGeoLocation() { final GeoLocationPoint pt = getGeoPosition(); if (pt == null) { return new GeoLocationNowhere(getUUID()); } return pt; } BusItineraryHalt(BusItinerary itinerary, String name, BusItineraryHaltType type);   BusItineraryHalt(UUID id, BusItinerary itinerary, String name, BusItineraryHaltType type);   BusItineraryHalt(BusItinerary itinerary, String name, BusItineraryHaltType type, AttributeCollection attributeProvider);   BusItineraryHalt(UUID id, BusItinerary itinerary, String name, BusItineraryHaltType type,
			AttributeCollection attributeProvider); @Override @Pure void toJson(JsonBuffer buffer); @Pure static String getFirstFreeBushaltName(BusItinerary busItinerary); @Override void rebuild(boolean fireEvents); @Pure int getInvalidListIndex(); @Override @Pure BusNetwork getBusNetwork(); @Pure BusStop getBusStop(); boolean setBusStop(BusStop busStop); @Override void setName(String name); @Pure Point2d getPosition2D(); @Pure Point1d getPosition1D(); @Pure RoadSegment getRoadSegment(); @Pure int getRoadSegmentIndex(); @Pure double getPositionOnSegment(); @Pure Direction1D getRoadSegmentDirection(); @Pure BusItineraryHaltType getType(); void setType(BusItineraryHaltType type); @Pure boolean isTerminus(); @Override @Pure int indexInParent(); @Pure boolean isStartingBusHalt(); @Pure boolean isEndingBusHalt(); @Pure boolean insideBusHub(); @Pure Iterable<BusHub> busHubs(); @Pure Iterator<BusHub> busHubIterator(); @Override Shape2d<?> getShape(); @Override @Pure final GeoLocation getGeoLocation(); @Pure GeoLocationPoint getGeoPosition(); @Pure double distanceToBusStop(); @Pure double distance(double x, double y); @Pure double distance(Point2D<?, ?> point); @Pure double distance(BusItineraryHalt halt); @Pure double distance(BusStop busStop); @Pure double distance(GeoLocationPoint point); static final double DISTANCE_BETWEEN_HALT_AND_ROAD_BORDER; }### Answer:
@Test public void testGetGeoLocation() { GeoLocation p; assertNull(this.halt.getRoadSegment()); this.halt.setRoadSegmentIndex(0); this.halt.checkPrimitiveValidity(); p = this.halt.getGeoLocation(); assertNotNull(p); assertTrue(p instanceof GeoLocationNowhere); this.itinerary.addRoadSegment(this.segment2); this.itinerary.addRoadSegment(this.segment1); p = this.halt.getGeoLocation(); assertNotNull(p); assertTrue(p instanceof GeoLocationNowhere); this.halt.setPositionOnSegment(4f); p = this.halt.getGeoLocation(); assertNotNull(p); assertTrue(p instanceof GeoLocationPoint); assertEpsilonEquals(-14f, ((GeoLocationPoint)p).getX()); assertEpsilonEquals(148f, ((GeoLocationPoint)p).getY()); this.halt.setRoadSegmentIndex(1); this.halt.checkPrimitiveValidity(); p = this.halt.getGeoLocation(); assertNotNull(p); assertTrue(p instanceof GeoLocationPoint); setDecimalPrecision(3); assertEpsilonEquals(-11.41421f, ((GeoLocationPoint)p).getX()); assertEpsilonEquals(145.9f, ((GeoLocationPoint)p).getY()); setDecimalPrecision(DEFAULT_DECIMAL_COUNT); this.halt.setRoadSegmentIndex(-1); this.halt.checkPrimitiveValidity(); p = this.halt.getGeoLocation(); assertNotNull(p); assertTrue(p instanceof GeoLocationNowhere); }