@Test
public void testLinearizeCubicSpline() {

    List<Point> pList = new ArrayList<Point>();
    pList.add( geomFac.createPoint( null, new double[] { -2, 0 }, null ) );
    pList.add( geomFac.createPoint( null, new double[] { -4, 0 }, null ) );
    pList.add( geomFac.createPoint( null, new double[] { -6, 1 }, null ) );
    CubicSpline spline = new DefaultCubicSpline( new PointsList( pList ),
                                                 geomFac.createPoint( null, new double[] { 0, -1 }, null ),
                                                 geomFac.createPoint( null, new double[] { -1, 1 }, null ) );
    int numOfPoints = 10000;
    Points pts = linearizer.linearize( spline, new NumPointsCriterion( numOfPoints ) ).getControlPoints();
    for ( int i = 0; i < numOfPoints; i++ ) {
        if ( Math.abs( pts.get( i ).get0() - -3 ) < 1E-3 ) {
            Assert.assertEquals( pts.get( i ).get1(), -0.535536466911, 1E-3 );
        }
        if ( Math.abs( pts.get( i ).get0() - -5 ) < 1E-3 ) {
            Assert.assertEquals( pts.get( i ).get1(), 0.4464878443629, 1E-3 );
        }
    }
}