@Test
public void testCorrectnessForDistanceCalculation2() {

	// Input.
	double[] timeSeries1 = { 1, 1, 2, 2, 3, 5 };
	double[] timeSeries2 = { 1, 2, 3, 5, 5, 6 };
	double alpha = 0.5;
	IDistanceMetric timeSeriesDistance = new DynamicTimeWarping();
	IDistanceMetric derivateDistance = new EuclideanDistance();
	// Expectation.
	double expectation = Math.cos(alpha) * 1 + Math.sin(alpha) * Math.sqrt(7);
	DerivateDistance dtd = new DerivateDistance(alpha, timeSeriesDistance, derivateDistance);
	double distance = dtd.distance(timeSeries1, timeSeries2);
	assertEquals(expectation, distance, 1.0E-5);
}