Buggy code:
public final class MatrixUtilsTest { protected double [ ] [ ] testData = new double [ ] [ ] { new double [ ] { 1.0 , 2.0 , 3.0 } , new double [ ] { 2.0 , 5.0 , 3.0 } , new double [ ] { 1.0 , 0.0 , 8.0 } } ; protected double [ ] [ ] nullMatrix = null ; protected double [ ] row = new double [ ] { 1 , 2 , 3 } ; protected BigDecimal [ ] bigRow = new BigDecimal [ ] { new BigDecimal ( 1 ) , new BigDecimal ( 2 ) , new BigDecimal ( 3 ) } ; protected String [ ] stringRow = new String [ ] { "1" , "2" , "3" } ; protected Fraction [ ] fractionRow = new Fraction [ ] { new Fraction ( 1 ) , new Fraction ( 2 ) , new Fraction ( 3 ) } ; protected double [ ] [ ] rowMatrix = new double [ ] [ ] { new double [ ] { 1 , 2 , 3 } } ; protected BigDecimal [ ] [ ] bigRowMatrix = new BigDecimal [ ] [ ] { new BigDecimal [ ] { new BigDecimal ( 1 ) , new BigDecimal ( 2 ) , new BigDecimal ( 3 ) } } ; protected String [ ] [ ] stringRowMatrix = new String [ ] [ ] { new String [ ] { "1" , "2" , "3" } } ; protected Fraction [ ] [ ] fractionRowMatrix = new Fraction [ ] [ ] { new Fraction [ ] { new Fraction ( 1 ) , new Fraction ( 2 ) , new Fraction ( 3 ) } } ; protected double [ ] col = new double [ ] { 0 , 4 , 6 } ; protected BigDecimal [ ] bigCol = new BigDecimal [ ] { new BigDecimal ( 0 ) , new BigDecimal ( 4 ) , new BigDecimal ( 6 ) } ; protected String [ ] stringCol = new String [ ] { "0" , "4" , "6" } ; protected Fraction [ ] fractionCol = new Fraction [ ] { new Fraction ( 0 ) , new Fraction ( 4 ) , new Fraction ( 6 ) } ; protected double [ ] nullDoubleArray = null ; protected double [ ] [ ] colMatrix = new double [ ] [ ] { new double [ ] { 0 } , new double [ ] { 4 } , new double [ ] { 6 } } ; protected BigDecimal [ ] [ ] bigColMatrix = new BigDecimal [ ] [ ] { new BigDecimal [ ] { new BigDecimal ( 0 ) } , new BigDecimal [ ] { new BigDecimal ( 4 ) } , new BigDecimal [ ] { new BigDecimal ( 6 ) } } ; protected String [ ] [ ] stringColMatrix = new String [ ] [ ] { new String [ ] { "0" } , new String [ ] { "4" } , new String [ ] { "6" } } ; protected Fraction [ ] [ ] fractionColMatrix = new Fraction [ ] [ ] { new Fraction [ ] { new Fraction ( 0 ) } , new Fraction [ ] { new Fraction ( 4 ) } , new Fraction [ ] { new Fraction ( 6 ) } } ; @ Test public void testCreateRealMatrix ( ) { } @ Test public void testcreateFieldMatrix ( ) { Assert . assertEquals ( new Array2DRowFieldMatrix < Fraction > ( MatrixUtilsTest . asFraction ( testData ) ) , MatrixUtils . createFieldMatrix ( MatrixUtilsTest . asFraction ( testData ) ) ) ; <START_BUG> Assert . assertEquals ( new Array2DRowFieldMatrix < Fraction > ( fractionColMatrix ) , MatrixUtils . createFieldMatrix ( fractionColMatrix ) ) ; <END_BUG> try { MatrixUtils . createFieldMatrix ( MatrixUtilsTest . asFraction ( new double [ ] [ ] { new double [ ] { 1 } , new double [ ] { 1 , 2 } } ) ) ; Assert . fail ( "Expecting<seq2seq4repair_space>MathIllegalArgumentException" ) ; } catch ( MathIllegalArgumentException ex ) { } try { MatrixUtils . createFieldMatrix ( MatrixUtilsTest . asFraction ( new double [ ] [ ] { new double [ ] { } , new double [ ] { } } ) ) ; Assert . fail ( "Expecting<seq2seq4repair_space>MathIllegalArgumentException" ) ; } catch ( MathIllegalArgumentException ex ) { } try { MatrixUtils . createFieldMatrix ( ( ( Fraction [ ] [ ] ) ( null ) ) ) ; Assert . fail ( "Expecting<seq2seq4repair_space>NullArgumentException" ) ; } catch ( NullArgumentException ex ) { } } @ Test public void testCreateRowRealMatrix ( ) { } @ Test public void testCreateRowFieldMatrix ( ) { } @ Test public void testCreateColumnRealMatrix ( ) { } @ Test public void testCreateColumnFieldMatrix ( ) { } protected void checkIdentityMatrix ( RealMatrix m ) { } @ Test public void testCreateIdentityMatrix ( ) { } protected void checkIdentityFieldMatrix ( FieldMatrix < Fraction > m ) { } @ Test public void testcreateFieldIdentityMatrix ( ) { } @ Test public void testBigFractionConverter ( ) { } @ Test public void testFractionConverter ( ) { } public static final Fraction [ ] [ ] asFraction ( double [ ] [ ] data ) { } public static final Fraction [ ] asFraction ( double [ ] data ) { } }

Fix:
Assert . assertEquals ( new Array2DRowFieldMatrix < Fraction > ( FractionField . getInstance ( ) , fractionColMatrix ) , MatrixUtils . createFieldMatrix ( fractionColMatrix ) ) ;