code: @Pure
  	protected ST replaceSegment(int index, ST segment) {
  		ST rep = null;
  		if (this.segmentReplacer != null) {
  			rep = this.segmentReplacer.replaceSegment(index, segment);
  		}
  		if (rep == null) {
  			rep = segment;
  		}
  		return rep;
  	}
docs: Invoked to replace a segment before adding it to the shortest path.
  
  <p>* By default, this function invoked the {@link AStarSegmentReplacer}
  associated to this AStar algorithm.
  
  @param index is the position of the segment in the path.
  @param segment is the segment to replace.
  @return the replacement segment or the {@code segment} itself.