@Test
public void sineWithOutlierTest() {

	long seed = 1234567L; // System.nanoTime() // change this to do random stress test
	double[] data = testDataGenerator.createNoisySeasonalData(144, 12, 1.0, 0.0, 0.0, seed);
	data[100] = 1000;
	SeasonalTrendLoess.Builder builder = new SeasonalTrendLoess.Builder().setPeriodLength(12).setSeasonalWidth(1000000).setRobust();
	SeasonalTrendLoess smoother = builder.buildSmoother(data);
	SeasonalTrendLoess.Decomposition stl = smoother.decompose();
	// printStlResults(data, stl);
	double epsilon = 1.0e-4;
	double[] trend = stl.getTrend();
	double[] seasonal = stl.getSeasonal();
	double[] residuals = stl.getResidual();
	for (int i = 0; i < data.length; ++i) {
		if (i != 100) {
			assertEquals(String.format("seasonal[%d]", i), data[i], seasonal[i], epsilon);
			assertEquals(String.format("trend[%d]", i), 0.0, trend[i], epsilon);
			assertEquals(String.format("residuals[%d]", i), 0.0, residuals[i], epsilon);
		} else {
			assertEquals(String.format("seasonal[%d]", i), data[i - 12], seasonal[i], epsilon);
			assertEquals(String.format("trend[%d]", i), 0.0, trend[i], epsilon);
			assertEquals(String.format("residuals[%d]", i), 1.0, residuals[i] / 1000.0, 1.0e-3);
		}
	}
}