public void testNotPos(){
  byte aBytes[]={-128,56,100,-2,-76,89,45,91,3,-15,35,26,-117};
  int aSign=1;
  byte rBytes[]={-1,127,-57,-101,1,75,-90,-46,-92,-4,14,-36,-27,116};
  BigInteger aNumber=new BigInteger(aSign,aBytes);
  BigInteger result=aNumber.not();
  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());
}

public void testNotPos ( ) { byte aBytes [ ] = { - 128 , 56 , 100 , - 2 , - 76 , 89 , 45 , 91 , 3 , - 15 , 35 , 26 , - 117 } ; int aSign = 1 ; byte rBytes [ ] = { - 1 , 127 , - 57 , - 101 , 1 , 75 , - 90 , - 46 , - 92 , - 4 , 14 , - 36 , - 27 , 116 } ; BigInteger aNumber = new BigInteger ( aSign , aBytes ) ; BigInteger result = aNumber . not ( ) ; 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 ( ) ) ; }
not for a positive number
