Code example for ECPoint

Methods: hashCode

0
    ) 
    public final void testEqualsObject01() { 
        // test case 1: must be equal to itself 
        ECPoint p2=null, p1 =
            new ECPoint(BigInteger.valueOf(-23456L), BigInteger.ONE);
        assertTrue(p1.equals(p1));
 
        // test case 2: equal objects 
        p1 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.ONE);
        p2 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(1L));
        assertTrue(p1.equals(p2) && p2.equals(p1));
 
        // test case 3: equal POINT_INFINITY object(s) 
        p1 = ECPoint.POINT_INFINITY;
        p2 = ECPoint.POINT_INFINITY;
        assertTrue(p1.equals(p2) && p2.equals(p1));
    } 
 
    /** 
     * Test #2 for <code>equals(Object other)</code> method<br> 
     * Assertion: return false if this and other objects are not equal<br>