### Question:
PackedRatingMatrix implements RatingMatrix { @Override public List<RatingMatrixEntry> getRatings() { return new PackedRatingCollection(data); } PackedRatingMatrix(PackedRatingData data); @Override LongCollection getUserIds(); @Override LongCollection getItemIds(); @Override KeyIndex userIndex(); @Override KeyIndex itemIndex(); @Override List<RatingMatrixEntry> getRatings(); @Override Collection<RatingMatrixEntry> getUserRatings(long userId); @Override synchronized Long2DoubleMap getUserRatingVector(long userId); @PreDestroy void dispose();  }### Answer:
@Test public void testBasicStats() { assertThat(snap.getRatings(), hasSize(20)); }
@Test public void testGetRatings() { List<RatingMatrixEntry> ratings = snap.getRatings(); assertEquals(20, ratings.size()); for (int i = 0; i < 20; i++) { RatingMatrixEntry entry = ratings.get(i); assertThat(entry.getIndex(), equalTo(i)); assertThat(ratingList, Matchers.<List<Rating>>anyOf(hasItem(rating(entry.getUserId(), entry.getItemId(), entry.getValue(), 1)), hasItem(rating(entry.getUserId(), entry.getItemId(), entry.getValue(), 2)))); } }