@Test
public void testCorrectnessForDistanceCalculation() {

    // Input.
    double[] timeSeries1 = { 1, 1, 1, 1, 1, 1 }; // complexity 5
    double[] timeSeries2 = { .0, Math.sqrt(8), .0, Math.sqrt(8), .0, Math.sqrt(8) }; // complexity 15
    // Expectation.
    double expectation = euclideanDistance.distance(timeSeries1, timeSeries2) * (15 / 5);
    ComplexityInvariantDistance cid = new ComplexityInvariantDistance(euclideanDistance, stretchingComplexity);
    double distance = cid.distance(timeSeries1, timeSeries2);
    assertEquals(expectation, distance, 0.001);
}