* Test preconditions: see test comments<br>
* Expected: all objects in this test must be equal
*/
public final void testEqualsObject01() {
// test case 1: must be equal to itself
EllipticCurve c2 = null, c1 = new EllipticCurve(new ECFieldFp(
BigInteger.valueOf(23L)), BigInteger.ONE, BigInteger
.valueOf(19L));
assertTrue(c1.equals(c1));
// test case 2: equal objects
c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.ONE, BigInteger.valueOf(19L));
c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.valueOf(1L), BigInteger.valueOf(19L));
assertTrue(c1.equals(c2) && c2.equals(c1));
// test case 3: equal objects with seed not null
c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.ONE, BigInteger.valueOf(19L), new byte[24]);
c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.valueOf(1L), BigInteger.valueOf(19L), new byte[24]);
assertTrue(c1.equals(c2) && c2.equals(c1));
// test case 4: equal object and subclass object
c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.ONE, BigInteger.valueOf(19L), new byte[24]);
MyEllipticCurve c3 = new MyEllipticCurve(new ECFieldFp(BigInteger
.valueOf(23L)), BigInteger.ONE, BigInteger.valueOf(19L),
new byte[24]);
assertTrue(c1.equals(c3) && c3.equals(c1));
// test case 5: equal objects
c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.ONE, BigInteger.valueOf(19L));
c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
BigInteger.valueOf(1L), BigInteger.valueOf(19L), null);
assertTrue(c1.equals(c2) && c2.equals(c1));
}