if (itemIDs.length == 0) {
return 0;
}
FastIDSet userIDs = preferenceForItems.get(itemIDs[0]);
if (userIDs == null) {
throw new NoSuchItemException();
}
FastIDSet intersection = new FastIDSet(userIDs.size());
intersection.addAll(userIDs);
int i = 1;
while (!intersection.isEmpty() && (i < itemIDs.length)) {
userIDs = preferenceForItems.get(itemIDs[i]);
if (userIDs == null) {
throw new NoSuchItemException();
}
intersection.retainAll(userIDs);
i++;
}
return intersection.size();