public static boolean intersects(RectangleLineIntersector intersector, PointList pointList) {
        int len = pointList.size();
        if (len == 0)
            throw new IllegalArgumentException("PointList must not be empty");

        Coordinate coords = new Coordinate(pointList.getLon(0), pointList.getLat(0));
        if (len == 1)
            return intersector.intersects(coords, coords);

        for (int pointIndex = 1; pointIndex < len; pointIndex++) {
            Coordinate nextCoords = new Coordinate(pointList.getLon(pointIndex), pointList.getLat(pointIndex));
            if (intersector.intersects(coords, nextCoords))
                return true;
            coords = nextCoords;
        }
        return false;
    }
@Test
    public void testPointListIntersect() {
        BBox bbox = new BBox(-0.5, 1, 1, 2);
        PointList pointList = new PointList();
        pointList.add(5, 5);
        pointList.add(5, 0);
        assertFalse(bbox.intersects(pointList));

        pointList.add(-5, 0);
        assertTrue(bbox.intersects(pointList));

        pointList = new PointList();
        pointList.add(5, 1);
        pointList.add(-1, 0);
        assertTrue(bbox.intersects(pointList));

        pointList = new PointList();
        pointList.add(5, 0);
        pointList.add(-1, 3);
        assertFalse(bbox.intersects(pointList));

        pointList = new PointList();
        pointList.add(5, 0);
        pointList.add(-1, 2);
        assertTrue(bbox.intersects(pointList));

        pointList = new PointList();
        pointList.add(1.5, -2);
        pointList.add(1.5, 2);
        assertTrue(bbox.intersects(pointList));
    }