class TransformDistance extends AWeightedTrigometricDistance {

	@Override
	public double distance(final double[] a, final double[] b) {
		double[] transformA = this.transform.transform(a);
		double[] transformB = this.transform.transform(b);
		return this.getA() * this.timeSeriesDistance.distance(a, b) + this.getB() * this.baseTransformDistance.distance(transformA, transformB);
	}

}

class TransformDistanceTest {

	@Test
	public void testCorrectnessForDistanceCalculation() {

		// Input.
		double[] timeSeries1 = { 1, 1, 1, 1, 1, 1 };
		double[] timeSeries2 = { 1, 1, 1, 1, 1, 1 };
		// Expectation.
		double expectation = 0;

		TransformDistance td = new TransformDistance(0.5, new DynamicTimeWarping());
		double distance = td.distance(timeSeries1, timeSeries2);

		assertEquals(expectation, distance, 0);
	}

}