List<Rating> ratings = new ArrayList<Rating>();
ratings.add(new SimpleRating(1, 2, 3.0, 1));
ratings.add(new SimpleRating(3, 2, 4.5, 2));
ratings.add(new SimpleRating(2, 2, 2.3, 3));
ratings.add(new SimpleRating(3, 2, 4.5, 10));
MutableSparseVector urv = Ratings.itemRatingVector(ratings);
assertThat(urv.isEmpty(), equalTo(false));
assertThat(urv.size(), equalTo(3));
assertThat(urv.get(1), closeTo(3.0, 1.0e-6));
assertThat(urv.get(3), closeTo(4.5, 1.0e-6));
assertThat(urv.get(2), closeTo(2.3, 1.0e-6));
assertThat(urv.containsKey(5), equalTo(false));
}