public Point2D containsPoint(Point2D position) {
        boolean intersect = false;
        Point2D point = null;
        Iterator it = this.getPoints().iterator();
        while (!intersect && it.hasNext()) {
            PathPoint pathPoint = (PathPoint) it.next();
            point = pathPoint.getPosition();
            Rectangle2D rect = (Rectangle2D) pathPoint.getBounds();
            if (rect.contains(position)) {
                intersect = true;
            }
        }
        if (!intersect) {
            point = null;
        }

        return point;
    }