public void testEqualObjects(){
  String value1="12378246728727834290276457386374882976782849";
  String value2="12378246728727834290276457386374882976782849";
  BigInteger aNumber1=new BigInteger(value1);
  BigInteger aNumber2=new BigInteger(value2);
  int code1=aNumber1.hashCode();
  int code2=aNumber2.hashCode();
  if (aNumber1.equals(aNumber2)) {
    assertTrue("hash codes for equal objects are unequal",code1 == code2);
  }
}

public void testEqualObjects ( ) { String value1 = "12378246728727834290276457386374882976782849" ; String value2 = "12378246728727834290276457386374882976782849" ; BigInteger aNumber1 = new BigInteger ( value1 ) ; BigInteger aNumber2 = new BigInteger ( value2 ) ; int code1 = aNumber1 . hashCode ( ) ; int code2 = aNumber2 . hashCode ( ) ; if ( aNumber1 . equals ( aNumber2 ) ) { assertTrue ( "hash codes for equal objects are unequal" , code1 == code2 ) ; } }
test hash codes for equal objects .
