@Test
public void ratingVector() throws Exception {

  PreferenceArray prefs = dataModel.getPreferencesFromUser(1);
  Vector ratingVector = ALSWRFactorizer.ratingVector(prefs);
  assertEquals(prefs.length(), ratingVector.getNumNondefaultElements());
  assertEquals(prefs.get(0).getValue(), ratingVector.get(0), EPSILON);
  assertEquals(prefs.get(1).getValue(), ratingVector.get(1), EPSILON);
  assertEquals(prefs.get(2).getValue(), ratingVector.get(2), EPSILON);
}