code: public final GraphIterationElement<ST, PT> nextElement() {
  		if (!this.courseModel.isEmpty()) {
  			final GraphIterationElement<ST, PT> theElement = this.courseModel.removeNextIterationElement();
  			if (theElement != null) {
  				final List<GraphIterationElement<ST, PT>> list = getNextSegments(true, theElement);
  				final Iterator<GraphIterationElement<ST, PT>> iterator;
  				boolean hasFollowingSegments = false;
  				GraphIterationElement<ST, PT> elt;
  
  				if (this.courseModel.isReversedRestitution()) {
  					iterator = new ReverseIterator<>(list);
  				} else {
  					iterator = list.iterator();
  				}
  
  				while (iterator.hasNext()) {
  					elt = iterator.next();
  					if (canGotoIntoElement(elt)) {
  						hasFollowingSegments = true;
  						this.courseModel.addIterationElement(elt);
  						if (!this.allowManyReplies) {
  							this.visited.add(elt);
  						}
  					}
  				}
  
  				theElement.setTerminalSegment(!hasFollowingSegments);
  				theElement.replied = true;
  				this.current = theElement;
  				return this.current;
  			}
  		}
  		clear();
  		throw new NoSuchElementException();
  	}
docs: Replies the next segment.
  
  @return the next segment