users.add(getUser("test2", 0.2, 0.3, 0.3, 0.6));
users.add(getUser("test3", 0.4, 0.4, 0.5, 0.9));
users.add(getUser("test4", 0.1, 0.4, 0.5, 0.8, 0.9, 1.0));
users.add(getUser("test5", 0.2, 0.3, 0.6, 0.7, 0.1, 0.2));
DataModel dataModel = new GenericDataModel(users);
Recommender recommender = new SlopeOneRecommender(dataModel);
List<RecommendedItem> fewRecommended = recommender.recommend("test1", 2);
List<RecommendedItem> moreRecommended = recommender.recommend("test1", 4);
for (int i = 0; i < fewRecommended.size(); i++) {
assertEquals(fewRecommended.get(i).getItem(), moreRecommended.get(i).getItem());
}
recommender.refresh(null);
for (int i = 0; i < fewRecommended.size(); i++) {
assertEquals(fewRecommended.get(i).getItem(), moreRecommended.get(i).getItem());
}
}