public void testCase20(){
  byte bBytes[]={1,2,3,4,5,6,7};
  byte rBytes[]={1,2,3,4,5,6,7};
  int bSign=1;
  BigInteger aNumber=BigInteger.ZERO;
  BigInteger bNumber=new BigInteger(bSign,bBytes);
  BigInteger result=aNumber.add(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());
}

public void testCase20 ( ) { byte bBytes [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; byte rBytes [ ] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 } ; int bSign = 1 ; BigInteger aNumber = BigInteger . ZERO ; BigInteger bNumber = new BigInteger ( bSign , bBytes ) ; BigInteger result = aNumber . add ( 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 ( ) ) ; }
add a number to zero
