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