@Test
public void constantDataExtrapolatesConstantValues() {

	double[] data = createConstantDataArray();
	for (int degree = 0; degree < 3; ++degree) {
		LoessInterpolator loess = new LoessInterpolator.Builder().setWidth(7).setDegree(degree).interpolate(data);
		Double y = loess.smoothOnePoint(-100, 0, data.length - 1);
		assertNotNull(y);
		assertEquals("Bad value extrapolating left", data[0], y, 3.0e-9);
		y = loess.smoothOnePoint(1000.0, 0, data.length - 1);
		assertNotNull(y);
		assertEquals("Bad value extrapolating right", data[0], y, 3.0e-9);
	}
}