@Test
public void periodicBuilderCanBeReused() {

	double[] data = SimulatedWeeklyMetric.getFourWeekValues();
	int periodicity = 1008;
	SeasonalTrendLoess.Builder builder = new SeasonalTrendLoess.Builder();
	builder.setPeriodLength(periodicity)
			.setRobust()
			.setPeriodic()
			.setFlatTrend();
	SeasonalTrendLoess stlSmoother = builder.buildSmoother(data);
	SeasonalTrendLoess.Decomposition stl = stlSmoother.decompose();
	assertNotNull(stl);
	builder.setRobustnessIterations(17);
	// Previously this resulted in an exception:
	// SeasonalTrendLoess.Builder: setSeasonalWidth and setPeriodic cannot both be called.
	stlSmoother = builder.buildSmoother(data);
	stl = stlSmoother.decompose();
	assertNotNull(stl);
}