private Map<Point, List<Point>> clusterPoints(List<Point> keys) {
        Map<Point, List<Point>> map = new TreeMap<Point, List<Point>>();

        for (Point point : points) {
            double min = Double.MAX_VALUE;
            Point k = null;
            for (Point key : keys) {
                double distance = getDistance(point, key);
                min = min < distance ? min : distance;
                k = key;
            }

//            List<Point> ps = map.get(k) == null ? new ArrayList<Point>() : map.get(k);
            List<Point> ps = map.get(k);
            if (ps == null) {
                ps = new ArrayList<Point>();
            }
            ps.add(point);
            map.put(k, ps);
        }

        return map;
    }