ChangeOfRegime extends AbstractTsModifier { @Override public TsDomain getDefinitionDomain() { return var.getDefinitionDomain(); } ChangeOfRegime(final ITsVariable var,
            final ChangeOfRegimeType regime, final Day day); @Override void data(TsDomain domain, List<DataBlock> data); Day getDay(); @Override TsDomain getDefinitionDomain(); @Override TsFrequency getDefinitionFrequency(); @Override String getDescription(TsFrequency context); @Override int getDim(); @Override String getItemDescription(int idx, TsFrequency context); ChangeOfRegimeType getRegime(); @Override ITsVariable getVariable(); @Override boolean isSignificant(TsDomain domain); @Override String getName();  }
@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()); }