MatrixAlgebraFactory { public static String getMatrixAlgebraName(final MatrixAlgebra algebra) { if (algebra == null) { return null; } return s_instanceNames.get(algebra.getClass()); } private  MatrixAlgebraFactory(); static MatrixAlgebra getMatrixAlgebra(final String algebraName); static String getMatrixAlgebraName(final MatrixAlgebra algebra); static final String COLT; static final String COMMONS; static final String OG; static final ColtMatrixAlgebra COLT_ALGEBRA; static final CommonsMatrixAlgebra COMMONS_ALGEBRA; static final OGMatrixAlgebra OG_ALGEBRA; }
@Test public void testBadClass() { assertNull(MatrixAlgebraFactory.getMatrixAlgebraName(new MatrixAlgebra() { @Override public double getCondition(final Matrix<?> m) { return 0; } @Override public double getDeterminant(final Matrix<?> m) { return 0; } @Override public double getInnerProduct(final Matrix<?> m1, final Matrix<?> m2) { return 0; } @Override public DoubleMatrix2D getInverse(final Matrix<?> m) { return null; } @Override public double getNorm1(final Matrix<?> m) { return 0; } @Override public double getNorm2(final Matrix<?> m) { return 0; } @Override public double getNormInfinity(final Matrix<?> m) { return 0; } @Override public DoubleMatrix2D getOuterProduct(final Matrix<?> m1, final Matrix<?> m2) { return null; } @Override public DoubleMatrix2D getPower(final Matrix<?> m, final int p) { return null; } @Override public DoubleMatrix2D getPower(final Matrix<?> m, final double p) { return null; } @Override public double getTrace(final Matrix<?> m) { return 0; } @Override public DoubleMatrix2D getTranspose(final Matrix<?> m) { return null; } @Override public Matrix<?> multiply(final Matrix<?> m1, final Matrix<?> m2) { return null; } })); }