public static Vector2D getClosest(ArrayList<Vector2D> list, Vector2D vec) {
        Vector2D closest = null;
        double distance = 0;

        for (Vector2D close : list) {
            double val = close.getDistance(vec);
            if (closest == null || val < distance && close != vec) {
                closest = close;
                distance = val;
            }
        }

        return closest;
    }