UserSimilarity similarity = new PearsonCorrelationSimilarity(dataModel);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(1, similarity, dataModel);
Recommender recommender = new GenericUserBasedRecommender(dataModel, neighborhood, similarity);
List<RecommendedItem> originalRecommended = recommender.recommend(1, 2);
List<RecommendedItem> rescoredRecommended =
recommender.recommend(1, 2, new ReversingRescorer<Long>());
assertNotNull(originalRecommended);
assertNotNull(rescoredRecommended);
assertEquals(2, originalRecommended.size());
assertEquals(2, rescoredRecommended.size());
assertEquals(originalRecommended.get(0).getItemID(), rescoredRecommended.get(1).getItemID());