length = actualLength.getLength();
length = Math.max(actualLength.getLength(), length);
    public void prepend(TrainPath additionalPath) {	PathLength l = additionalPath.actualLength;	IntLine tail = (IntLine) additionalPath.segments.getLast();	IntLine head = getFirstSegment();	int tailDir = tail.getDirection();	if (tailDir == 0 || (tailDir == head.getDirection())) {	    head.prepend(tail);	} else {	    segments.addFirst(tail);	}	/* add the rest of the path */	ListIterator i =	    additionalPath.segments.listIterator(additionalPath.segments.size()		    - 1);	while (i.hasPrevious()) {	    segments.addFirst(i.previous());	}	actualLength.add(l);	length = actualLength.getLength();    }