Buggy code:
public static final BigDecimal [ ] [ ] asBigDecimal ( double [ ] [ ] data ) { } public void testDimensions ( ) { } public void testCopyFunctions ( ) { } public void testConstructors ( ) { } public void testAdd ( ) { } public void testAddFail ( ) { } public void testNorm ( ) { } public void testPlusMinus ( ) { } public void testMultiply ( ) { } private double [ ] [ ] d3 = new double [ ] [ ] { new double [ ] { 1 , 2 , 3 , 4 } , new double [ ] { 5 , 6 , 7 , 8 } } ; private double [ ] [ ] d4 = new double [ ] [ ] { new double [ ] { 1 } , new double [ ] { 2 } , new double [ ] { 3 } , new double [ ] { 4 } } ; private double [ ] [ ] d5 = new double [ ] [ ] { new double [ ] { 30 } , new double [ ] { 70 } } ; public void testMultiply2 ( ) { } public void testIsSingular ( ) { } public void testInverse ( ) { } public void testSolve ( ) { } public void testDeterminant ( ) { } public void testTrace ( ) { } public void testScalarAdd ( ) { } public void testOperate ( ) { } public void testTranspose ( ) { } public void testPremultiplyVector ( ) { } public void testPremultiply ( ) { } public void testGetVectors ( ) { } public void testLUDecomposition ( ) throws Exception { } public void testSubMatrix ( ) { } public void testGetColumnMatrix ( ) { } public void testGetRowMatrix ( ) { } public void testEqualsAndHashCode ( ) { } public void testToString ( ) { } public void testSetSubMatrix ( ) throws Exception { BigDecimal [ ] [ ] detData3 = MatrixUtils . createBigMatrix ( detData2 ) . getData ( ) ; BigMatrixImpl m = new BigMatrixImpl ( testData ) ; m . setSubMatrix ( detData3 , 1 , 1 ) ; BigMatrix expected = MatrixUtils . createBigMatrix ( new double [ ] [ ] { new double [ ] { 1.0 , 2.0 , 3.0 } , new double [ ] { 2.0 , 1.0 , 3.0 } , new double [ ] { 1.0 , 2.0 , 4.0 } } ) ; assertEquals ( expected , m ) ; m . setSubMatrix ( detData3 , 0 , 0 ) ; expected = MatrixUtils . createBigMatrix ( new double [ ] [ ] { new double [ ] { 1.0 , 3.0 , 3.0 } , new double [ ] { 2.0 , 4.0 , 3.0 } , new double [ ] { 1.0 , 2.0 , 4.0 } } ) ; assertEquals ( expected , m ) ; BigDecimal [ ] [ ] testDataPlus3 = MatrixUtils . createBigMatrix ( testDataPlus2 ) . getData ( ) ; m . setSubMatrix ( testDataPlus3 , 0 , 0 ) ; expected = MatrixUtils . createBigMatrix ( new double [ ] [ ] { new double [ ] { 3.0 , 4.0 , 5.0 } , new double [ ] { 4.0 , 7.0 , 5.0 } , new double [ ] { 3.0 , 2.0 , 10.0 } } ) ; assertEquals ( expected , m ) ; <START_BUG> BigMatrix matrix = MatrixUtils . createBigMatrix ( new double [ ] [ ] { new double [ ] { 1 , 2 , 3 , 4 } , new double [ ] { 5 , 6 , 7 , 8 } , new double [ ] { 9 , 0 , 1 , 2 } } ) ; <END_BUG> matrix . setSubMatrix ( new BigDecimal [ ] [ ] { new BigDecimal [ ] { new BigDecimal ( 3 ) , new BigDecimal ( 4 ) } , new BigDecimal [ ] { new BigDecimal ( 5 ) , new BigDecimal ( 6 ) } } , 1 , 1 ) ; expected = MatrixUtils . createBigMatrix ( new BigDecimal [ ] [ ] { new BigDecimal [ ] { new BigDecimal ( 1 ) , new BigDecimal ( 2 ) , new BigDecimal ( 3 ) , new BigDecimal ( 4 ) } , new BigDecimal [ ] { new BigDecimal ( 5 ) , new BigDecimal ( 3 ) , new BigDecimal ( 4 ) , new BigDecimal ( 8 ) } , new BigDecimal [ ] { new BigDecimal ( 9 ) , new BigDecimal ( 5 ) , new BigDecimal ( 6 ) , new BigDecimal ( 2 ) } } ) ; assertEquals ( expected , matrix ) ; try { m . setSubMatrix ( matrix . getData ( ) , 1 , 1 ) ; fail ( "expecting<seq2seq4repair_space>MatrixIndexException" ) ; } catch ( MatrixIndexException e ) { } try { m . setSubMatrix ( null , 1 , 1 ) ; fail ( "expecting<seq2seq4repair_space>NullPointerException" ) ; } catch ( NullPointerException e ) { } try { m . setSubMatrix ( new BigDecimal [ ] [ ] { new BigDecimal [ ] { new BigDecimal ( 1 ) } , new BigDecimal [ ] { new BigDecimal ( 2 ) , new BigDecimal ( 3 ) } } , 0 , 0 ) ; fail ( "expecting<seq2seq4repair_space>IllegalArgumentException" ) ; } catch ( IllegalArgumentException e ) { } try { m . setSubMatrix ( new BigDecimal [ ] [ ] { new BigDecimal [ ] { } } , 0 , 0 ) ; fail ( "expecting<seq2seq4repair_space>IllegalArgumentException" ) ; } catch ( IllegalArgumentException e ) { } } protected void assertClose ( String msg , BigMatrix m , BigMatrix n , double tolerance ) { }

Fix:
BigMatrixImpl matrix = ( ( BigMatrixImpl ) ( MatrixUtils . createBigMatrix ( new double [ ] [ ] { new double [ ] { 1 , 2 , 3 , 4 } , new double [ ] { 5 , 6 , 7 , 8 } , new double [ ] { 9 , 0 , 1 , 2 } } ) ) ) ;