System.out.println("actual length = " + actualLength.getLength() + " length = " + length);
    public Point moveTailTo(TrainPath additionalPath) {	ListIterator i = additionalPath.segments.listIterator(0);	IntLine additionalHead = (IntLine) i.next();	IntLine tail = getLastSegment();	Point oldHeadPoint = new Point (additionalHead.x1, additionalHead.y1);	if (tail.getDirection() == additionalHead.getDirection()) {	    tail.append(additionalHead);	} else {	    segments.add(additionalHead);	}	actualLength.add(additionalHead.getLength());	/* add the rest of the path */	while (i.hasNext()) {	    additionalHead = (IntLine) i.next();	    segments.add(additionalHead);	    actualLength.add(additionalHead.getLength());	}	IntLine head = null;	System.out.println("actual length = " + actualLength.getLength() + 		" length = " + length);	while (actualLength.getLength() > length) {	    head = (IntLine) segments.removeFirst();	    actualLength.subtract(head.getLength());	};	System.out.println("2: actual length = " + actualLength.getLength() + 		" length = " + length);	if (actualLength.getLength() < length && head != null) {	    PathLength headLength = new PathLength(head.getLength());	    headLength.setLength(length - actualLength.getLength());	    head.setLengthFromTail(headLength);	    segments.addFirst(head);	}	System.out.println("3: actual length = " + actualLength.getLength() + 		" length = " + length);	return oldHeadPoint;    }