@Test
public void testMakeTransformation() {
MeanVarianceNormalizer urvn;
urvn = new MeanVarianceNormalizer();
VectorTransformation trans = urvn.makeTransformation(userRatings);
MutableSparseVector nUR = userRatings.mutableCopy();
final double mean = 2.0;
final double stdev = Math.sqrt(8.0 / 3.0);
trans.apply(nUR);
//Test apply
Assert.assertEquals((0.0 - mean) / stdev, nUR.get(0L), MIN_DOUBLE_PRECISION);
Assert.assertEquals((2.0 - mean) / stdev, nUR.get(1L), MIN_DOUBLE_PRECISION);
Assert.assertEquals((4.0 - mean) / stdev, nUR.get(2L), MIN_DOUBLE_PRECISION);
trans.unapply(nUR);
//Test unapply
Assert.assertEquals(0.0, nUR.get(0L), MIN_DOUBLE_PRECISION);
Assert.assertEquals(2.0, nUR.get(1L), MIN_DOUBLE_PRECISION);
Assert.assertEquals(4.0, nUR.get(2L), MIN_DOUBLE_PRECISION);
}