public int test(GraphPoint p, boolean weighted)
	{
		// Start building a list of neighbours of this point
		List<GraphPoint> neighbours = new ArrayList<GraphPoint>();
		
		Iterator<GraphPoint> iter = points.iterator();
		while(iter.hasNext())
		{
			GraphPoint point = iter.next();
			if(p.equals(point)) 
				return point.getClassification();
			if(isNeighbour(p, point))
				neighbours.add(point);
		}
        List<GraphPoint> toTest = new ArrayList<GraphPoint>();
        if (K == 0) // adaptive!
            toTest = neighbours;
        else
        {
            Collections.sort(neighbours, new DistanceComparator(p));
            toTest = neighbours.subList(0, (Math.min(K, neighbours.size())));
        }
        if (weighted)
        {
            return getWeightedClassification(p, toTest);
        }
        else
        {
            return getFirstOrderClassification(toTest);
        }

    }