question: public void testDivisionKnuth1 ( ) { byte aBytes [ ] = { - 7 , - 6 , - 5 , - 4 , - 3 , - 2 , - 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; byte bBytes [ ] = { - 3 , - 3 , - 3 , - 3 } ; int aSign = 1 ; int bSign = 1 ; byte rBytes [ ] = { 0 , - 5 , - 12 , - 33 , - 96 , - 36 , - 105 , - 56 , 92 , 15 , 48 , - 109 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . divide ( bNumber ) ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = result . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , result . signum ( ) ) ; }
target:  Verifies the case when borrow != 0 in the private divide method.