question: public void testSetBitTopPositive ( ) { byte aBytes [ ] = { 1 , - 128 , 56 , 100 , - 15 , 35 , 26 } ; int aSign = 1 ; int number = 63 ; byte rBytes [ ] = { 0 , - 128 , 1 , - 128 , 56 , 100 , - 15 , 35 , 26 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger result = aNumber . setBit ( 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:  setBit(int n) the leftmost bit in a positive number