@Test
public void testTD() {

    Matrix M1 = new Matrix(251, 6);
    Matrix M2 = new Matrix(251, 6);
    TsDomain all = new TsDomain(TsFrequency.Monthly, 1975, 7, 251);
    GregorianCalendarVariables var = GregorianCalendarVariables.getDefault(TradingDaysType.TradingDays);
    var.data(all, M1.columnList());
      System.out.println("all");
      System.out.println(M1);
    TsVariableWindow wnd1 = new TsVariableWindow(var, new Day(1970, Month.January, 0), new Day(1982, Month.April, 29));
    TsVariableWindow wnd2 = new TsVariableWindow(var, new Day(1982, Month.May, 0), Day.toDay());
    wnd1.data(all, M2.columnList());
    assertTrue(M1.distance(M2) > 1e-9);
      System.out.println("wnd1");
      System.out.println(M2);
    wnd2.data(all, M2.columnList());
      System.out.println("wnd2");
      System.out.println(M2);
    assertTrue(M1.distance(M2) < 1e-9);
}