@Test
public void linearTrendTest() {

	long seed = 1234567L; // System.nanoTime() // change this to do random stress test
	double[] data = testDataGenerator.createNoisySeasonalData(144, 12, 1.0, 0.2, 0.1, seed);
	SeasonalTrendLoess.Builder builder = new SeasonalTrendLoess.Builder().setLinearTrend().setPeriodLength(12).setSeasonalWidth(1000000).setRobust();
	SeasonalTrendLoess smoother = builder.buildSmoother(data);
	SeasonalTrendLoess.Decomposition stl = smoother.decompose();
	double[] trend = stl.getTrend();
	double dt = trend[1] - trend[0];
	for (int i = 1; i < trend.length; ++i)
		assertEquals(dt, trend[i] - trend[i-1], 1.0e-14);
	double dx = 2 * Math.PI / 12;
	assertEquals(dt, 0.2 * dx, 1.0e-4);
}