question: public void testShiftRightNegNonZeroes ( ) { byte aBytes [ ] = { 1 , - 128 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; int aSign = - 1 ; int number = 68 ; byte rBytes [ ] = { - 25 , - 4 , 121 , - 80 , 20 , - 70 , 109 , 42 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger result = aNumber . shiftRight ( number ) ; 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:  shiftRight a negative number; shift distance is NOT multiple of 32; shifted bits are NOT zeroes. 