@Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj instanceof Grid) {
            Grid<?> other = (Grid<?>) obj;
            return rowCount() == other.rowCount() &&
                    columnCount() == other.columnCount() &&
                    cells().equals(other.cells());
        }
        return false;
    }