@Test
public void test() {

    TsPeriod p = var.getDefinitionDomain().getStart().plus(var.getDefinitionDomain().getLength() / 2);
    ChangeOfRegime x1 = new ChangeOfRegime(var, ChangeOfRegimeType.ZeroStarted, p.firstday());
    ChangeOfRegime x2 = new ChangeOfRegime(var, ChangeOfRegimeType.ZeroEnded, p.firstday());
    TsVariableGroup group = new TsVariableGroup("test", new ITsVariable[]{var, x1, x2});
    Matrix matrix = RegressionUtilities.matrix(group, var.getDefinitionDomain());
    DataBlock c=matrix.column(0).deepClone();
    c.sub(matrix.column(1));
    c.sub(matrix.column(2));
    assertTrue(c.isZero());
}