@Test(expected = CardinalityException.class)
public void testPredictOnAnObservationWithWrongCardinality() {

    Vector weights = new DenseVector(new double[]{2.0, 3.0});
    LinearRegressionModel mdl = new LinearRegressionModel(weights, 1.0);
    Vector observation = new DenseVector(new double[]{1.0});
    mdl.predict(observation);
}