public void testValueOfLongMax(){
  long longVal=Long.MAX_VALUE;
  BigInteger aNumber=BigInteger.valueOf(longVal);
  byte rBytes[]={127,-1,-1,-1,-1,-1,-1,-1};
  byte resBytes[]=new byte[rBytes.length];
  resBytes=aNumber.toByteArray();
  for (int i=0; i < resBytes.length; i++) {
    assertTrue(resBytes[i] == rBytes[i]);
  }
  assertEquals("incorrect sign",1,aNumber.signum());
}

public void testValueOfLongMax ( ) { long longVal = Long . MAX_VALUE ; BigInteger aNumber = BigInteger . valueOf ( longVal ) ; byte rBytes [ ] = { 127 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 , - 1 } ; byte resBytes [ ] = new byte [ rBytes . length ] ; resBytes = aNumber . toByteArray ( ) ; for ( int i = 0 ; i < resBytes . length ; i ++ ) { assertTrue ( resBytes [ i ] == rBytes [ i ] ) ; } assertEquals ( "incorrect sign" , 1 , aNumber . signum ( ) ) ; }
valueof ( long val ) : convert long . max_value to a biginteger .
