@Test
public void testCorrectnessForDistanceCalculation2() {

	// Input.
	double[] timeSeries1 = { 1, 2, 3, 4, 5 }; // transform { -6.0833, -5.6666667, -4, -0.6666667, 6.41666667 },
												// derivate { 1, 1, 1, 1}
	double[] timeSeries2 = { 2, 2, 2, 2, 2 }; // transform { -4.166667, -1.666667, 0, 1.666667, 4.166667 }, derivate
												// { 0, 0, 0, 0}
	double a = 0.5;
	double b = 0.25;
	double c = 0.25;
	ADerivateFilter derivate = new BackwardDifferenceDerivate();
	IVectorTransform transform = new HilbertTransform();
	IDistanceMetric euclideanDistance = new EuclideanDistance();
	// Expectation.
	double expectation = a * Math.sqrt(15) + b * Math.sqrt(4) + c * 6.79562;
	DerivateTransformDistance dtd = new DerivateTransformDistance(a, b, c, derivate, transform, euclideanDistance);
	double distance = dtd.distance(timeSeries1, timeSeries2);
	assertEquals(expectation, distance, 1.0E-5);
}