ArrayList<Neighbor> tmp = new ArrayList<Neighbor>();
for(int i = 0, max = potentialSimilars.length; i < max; i++) {
long targetId = potentialSimilars[i];
double [] targetVec = rawVectorMap.get(targetId);
double score = scoreThresh.score(srcVec, targetVec);
if (scoreThresh.threshold(score)) tmp.add(new Neighbor(targetId, score));
}
Neighbor [] neighbors = tmp.toArray(new Neighbor[tmp.size()]);
if (neighbors != null) Arrays.sort(neighbors, comparator);