private List<RecommendedItem> doMostSimilarItems(long[] itemIDs,
int howMany,
TopItems.Estimator<Long> estimator) throws TasteException {
DataModel model = getDataModel();
FastIDSet possibleItemsIDs = new FastIDSet();
for (long itemID : itemIDs) {
PreferenceArray prefs = model.getPreferencesForItem(itemID);
int size = prefs.length();
for (int i = 0; i < size; i++) {
long userID = prefs.get(i).getUserID();
possibleItemsIDs.addAll(model.getItemIDsFromUser(userID));
}
}
possibleItemsIDs.removeAll(itemIDs);
return TopItems.getTopItems(howMany, possibleItemsIDs.iterator(), null, estimator);
}