Intersection dest = bestRoute.getDestinationIntersection();
    protected void populatePointsAndSegments(Route bestRoute, List newPoints,                                             List segments) {        Projection proj = getProjection();        Intersection origin = bestRoute.getOriginIntersection();        Intersection dest = bestRoute.getDestinationIntersection();        if (logger.isLoggable(Level.INFO))            logger.info("adding " + bestRoute.roads.length + " new roads.");        Road road = null;        Intersection last = null;        Intersection from = origin, to = null;        last = null;        Set loopSet = new HashSet();        if (doLoopCheck)            loopSet.add(origin);        Set ptSet = new HashSet();        for (int i = 0; i < bestRoute.roads.length; i++) {            road = bestRoute.roads[i];            if (!from.equals(road.getFirstIntersection())                    && !from.equals(road.getSecondIntersection())) {                logger.severe("huh? " + from                        + " is not an intersection on road " + road);            }            Point pt = createPoint(proj.forward(from.getLocation()));            if (doLoopCheck) {                if (ptSet.contains(pt)) {                    logger.warning("pt set has duplicate at " + pt);                }                ptSet.add(pt);            }            newPoints.add(pt);            to = road.getOtherIntersection(from);            if (doLoopCheck) {                if (loopSet.contains(to)) {                    logger.warning("road has a cycle at " + to);                }                loopSet.add(to);            }            // check to see if we need to reverse the order of the            // road points,            // which may not be ordered the same as the previous road            boolean reverse = from.equals(road.getSecondIntersection());            Segment path = getPathSegment(proj, road, reverse);            if (logger.isLoggable(Level.INFO))                logger.info("created path " + path);            segments.add(path);            from = to;        }        Point pt = createPoint(proj.forward(to.getLocation()));        if (ptSet.contains(pt)) {            logger.warning("pt set has duplicate at " + pt);        }        newPoints.add(pt);        if (logger.isLoggable(Level.INFO))            logger.info(" now " + newPoints.size() + " points and "                    + segments.size() + " segments.");    }