### Question:
OGMatrixAlgebra extends MatrixAlgebra { @Override public DoubleMatrix getOuterProduct(Matrix m1, Matrix m2) { ArgChecker.notNull(m1, "m1"); ArgChecker.notNull(m2, "m2"); if (m1 instanceof DoubleArray && m2 instanceof DoubleArray) { DoubleArray array1 = (DoubleArray) m1; DoubleArray array2 = (DoubleArray) m2; return DoubleMatrix.of( array1.size(), array2.size(), (i, j) -> array1.get(i) * array2.get(j)); } throw new IllegalArgumentException("Can only find outer product of DoubleArray; have " + m1.getClass() + " and " + m2.getClass()); }  @Override double getCondition(Matrix m); @Override double getDeterminant(Matrix m); @Override double getInnerProduct(Matrix m1, Matrix m2); @Override DoubleMatrix getInverse(Matrix m); @Override double getNorm1(Matrix m); @Override double getNorm2(Matrix m); @Override double getNormInfinity(Matrix m); @Override DoubleMatrix getOuterProduct(Matrix m1, Matrix m2); @Override DoubleMatrix getPower(Matrix m, int p); @Override double getTrace(Matrix m); @Override DoubleMatrix getTranspose(Matrix m); @Override Matrix multiply(Matrix m1, Matrix m2); @Override DoubleMatrix getPower(Matrix m, double p);  }### Answer:
@Test public void testOuterProduct() { final DoubleMatrix res = ALGEBRA.getOuterProduct(E, F); final int rows = res.rowCount(); final int cols = res.columnCount(); int i, j; for (i = 0; i < rows; i++) { for (j = 0; j < cols; j++) { assertThat(res.get(i, j)).isCloseTo(E.get(i) * F.get(j), offset(1e-15)); } } }