@Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof DenseGrid) {
            DenseGrid<?> other = (DenseGrid<?>) obj;
            return Arrays.equals(values, other.values);
        }
        return super.equals(obj);
    }