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