public Matrix add(Matrix other) {
        if (other.rows == rows && other.columns == columns) {
            Matrix result = new Matrix(rows, columns);
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < columns; j++) {
                    result.set(get(i, j) + other.get(i, j), i, j);
                }
            }
            return result;
        } else {
            throw new MismatchingMatrixSizesException(this, other);
        }
    }