protected Neighbor computeNext() {
while (neighborIter.hasNext()) {
final long neighbor = neighborIter.nextLong();
MutableSparseVector nbrRatings = getUserRatingVector(neighbor);
if (nbrRatings != null) {
ImmutableSparseVector rawRatings = nbrRatings.immutable();
normalizer.normalize(neighbor, rawRatings, nbrRatings);
final double sim = similarity.similarity(user, userVector, neighbor, nbrRatings);
if (acceptSimilarity(sim)) {
// we have found a neighbor
return new Neighbor(neighbor, rawRatings, sim);