IntLine tail = (IntLine) additionalPath.segments.removeLast();
IntLine tail = (IntLine) additionalPath.segments.getLast();
    public void prepend(TrainPath additionalPath) {	PathLength l = additionalPath.actualLength;	IntLine tail = (IntLine) additionalPath.segments.removeLast();	IntLine head = getFirstSegment();	int tailDir = tail.getDirection();	if (tailDir == 0 || (tailDir == head.getDirection())) {	    System.out.println("prepending " + tail + " to " + head);	    head.prepend(tail);	} else {	    segments.addFirst(tail);	}	/* add the rest of the path */	while (! additionalPath.segments.isEmpty()) {	    segments.addFirst(additionalPath.segments.removeLast());	}	actualLength.add(l);	length = (int) actualLength.getLength();    }