public void testBigIntsRoundTrip(){
  for (int i=0; i < 10000; i++) {
    BigInteger value=TestUtil.nextBigInteger(random(),16);
    int length=value.toByteArray().length;
    int maxLength=TestUtil.nextInt(random(),length,length + 3);
    byte[] encoded=new byte[maxLength];
    NumericUtils.bigIntToSortableBytes(value,maxLength,encoded,0);
    assertEquals(value,NumericUtils.sortableBytesToBigInt(encoded,0,maxLength));
  }
}

public void testBigIntsRoundTrip ( ) { for ( int i = 0 ; i < 10000 ; i ++ ) { BigInteger value = TestUtil . nextBigInteger ( random ( ) , 16 ) ; int length = value . toByteArray ( ) . length ; int maxLength = TestUtil . nextInt ( random ( ) , length , length + 3 ) ; byte [ ] encoded = new byte [ maxLength ] ; NumericUtils . bigIntToSortableBytes ( value , maxLength , encoded , 0 ) ; assertEquals ( value , NumericUtils . sortableBytesToBigInt ( encoded , 0 , maxLength ) ) ; } }
test round - trip encoding of random big integers
