question: public void testNegPosFirstLonger ( ) { byte aBytes [ ] = { - 128 , 9 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 , - 117 , 23 , 87 , - 25 , - 75 } ; byte bBytes [ ] = { - 2 , - 3 , - 4 , - 4 , 5 , 14 , 23 , 39 , 48 , 57 , 66 , 5 , 14 , 23 } ; int aSign = - 1 ; int bSign = 1 ; byte rBytes [ ] = { 73 , - 92 , - 48 , 4 , 12 , 6 , 4 , 32 , 48 , 64 , 0 , 8 , 3 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . and ( 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:  And for a negative and a positive numbers; the first is longer