class MatrixAlgebra {

  public Matrix<?> divide(final Matrix<?> m1, final Matrix<?> m2) {
    Validate.notNull(m1, "m1");
    Validate.notNull(m2, "m2");
    Validate.isTrue(m1 instanceof DoubleMatrix2D, "Can only divide a 2D matrix");
    Validate.isTrue(m2 instanceof DoubleMatrix2D, "Can only perform division with a 2D matrix");
    return multiply(m1, getInverse(m2));
  }

}