public double test(Collection<EuclideanDoublePoint> points, int l, double threshold) {
		int match = 0;
		int total = 0;
		int tp = 0;
		int tn = 0;
		int fp = 0;
		int fn = 0;
		
		java.util.Iterator<EuclideanDoublePoint> iter = points.iterator();
		while (iter.hasNext()) {
			EuclideanDoublePoint point = iter.next();
			int length = point.getPoint().length;
			Collection<SimilarityPair> sortedSurrogateSimilarities = computeSortedSurrogateSimilarities(point); 
			
			for (int i = 0; i < length; i++) {
				// Skip test cases with affinity 0.0 (no occurrence in dataset)
				if (point.getPoint()[i] == 0.0) {
					continue;
				}
					
				double score = computePredictionScore(sortedSurrogateSimilarities, point, i, l);
				//System.out.println("score = " + score + " pointi = " + point.getPoint()[i]);
				
				if (score > threshold) {
					if (point.getPoint()[i] > 0.5) {
						match++;
						tp++;
					} else {
						fp++;
					}
				} else {
					if (point.getPoint()[i] <= 0.5) {
						match++;
						tn++;
					} else {
						fn++;
					}
				}
				total++;
			}
		}
		
		double accuracy = (double)match / (double)total;
		double precision = (double)tp / (double)(tp + fp);
		double recall = (double)tp / (double)(tp + fn);
		System.out.println("Accuracy = " + accuracy + "\nPrecision = " + precision + "\nRecall = " + recall);
		System.out.println("Confusion matrix:\ntp = " + tp + " tn = " + tn + " fp = " + fp + " fn = " + fn);
		return accuracy;
	}