public void testRecommendedBecause() throws Exception {
ItemBasedRecommender recommender = buildRecommender2();
List<RecommendedItem> recommendedBecause = recommender.recommendedBecause(1, 4, 3);
assertNotNull(recommendedBecause);
assertEquals(3, recommendedBecause.size());
RecommendedItem first = recommendedBecause.get(0);
RecommendedItem second = recommendedBecause.get(1);
RecommendedItem third = recommendedBecause.get(2);
assertEquals(2, first.getItemID());
assertEquals(0.99f, first.getValue(), EPSILON);
assertEquals(3, second.getItemID());
assertEquals(0.4f, second.getValue(), EPSILON);
assertEquals(0, third.getItemID());
assertEquals(0.2f, third.getValue(), EPSILON);
}