@Test
public void testTransformLinear_increasingOrder() {
NumericTransformer numTran = new NumericTransformer();
numTran.setMode(TransformationMode.LINEAR);
numTran.defaults(1.2, 0.8);
FloatValue value = new FloatValue();
value.setValue(0.5);
TargetValue res = numTran.transform(value);
Assert.assertTrue(res.getValue() == 0);
value.setValue(0.85);
res = numTran.transform(value);
// System.out.println(res.getValue());
Assert.assertTrue(Math.abs(res.getValue() - 1.5) <= 10e-8);
FloatValue x1 = new FloatValue();
x1.setValue(0.91);
FloatValue x2 = new FloatValue();
x2.setValue(1.07);
TargetValue y1 = numTran.transform(x1);
TargetValue y2 = numTran.transform(x2);
FloatValue xt = new FloatValue();
xt.setValue(1.02);
double expected = ((y2.getValue() - y1.getValue()) / (x2.getValue() - x1.getValue()))
* (xt.getValue() - x1.getValue()) + y1.getValue();
TargetValue rez = numTran.transform(xt);
// System.out.println(expected + " " + rez.getValue());
Assert.assertTrue(Math.abs(rez.getValue() - expected) <= 10e-8);
}