class BezierCurve implements IShape {

    public List<Point> getPiecewiseLinearApproximation() {
        List<Point> points = new ArrayList<>();
        points.add(controlPoints.get(0));

        recursiveApproximation(controlPoints.get(0).getX(), controlPoints.get(0).getY(),
                controlPoints.get(1).getX(), controlPoints.get(1).getY(),
                controlPoints.get(2).getX(), controlPoints.get(2).getY(),
                controlPoints.get(3).getX(), controlPoints.get(3).getY(), points);

        points.add(controlPoints.get(controlPoints.size() - 1));
        return points;
    }

    public  BezierCurve(List<Point> controlPoints);

}