public Point[] findKClosestPoints(Point[] points, int k, final Point origin) {
		if (points == null || points.length == 0 || points.length < k) {
			return points;
		}
		
		Point[] result = new Point[k];
		
		PriorityQueue<Point> queue = new PriorityQueue<Point>(k, new Comparator<Point>() {
			@Override
			public int compare(Point a, Point b) {
				return b.distanceTo(origin) > a.distanceTo(origin) ? 1 : -1;
			}
		});
		
		for (Point point : points) {
			queue.offer(point);
			
			if (queue.size() > k) {
				queue.poll();
			}
		}
		
		for (int i = 0; i < k; i++) {
			if (!queue.isEmpty()) {
				result[i] = queue.poll();
			}
		}
		
		return result;
	}