@Test
public void shouldExtrapolateFourPeriodsForwards() {

	final int period = 24;
	double[] data = new double[2 * period];
	final double dx = 2 * PI / period;
	for (int i = 0; i < data.length; ++i) {
		final int amplitude = 10 - i / period;
		data[i] = amplitude * Math.sin(i * dx);
	}
	double[] extendedData = new double[6 * period];
	Builder builder = new Builder();
	builder = builder.setWidth(7); // Sub-cycle data is linear so width shouldn't matter
	builder = builder.extrapolateForwardOnly(4);
	CyclicSubSeriesSmoother sssmoother = builder.setDataLength(data.length).setPeriodicity(period).build();
	sssmoother.smoothSeasonal(data, extendedData, null);
	for (int i = 0; i < extendedData.length; ++i) {
		final int amplitude = 10 - i / period;
		final double value = amplitude * Math.sin(i * dx);
		assertEquals(String.format("test point %d", i), value, extendedData[i], 1.0e-11);
	}
}