Point implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Point other = (Point) obj; if (this.infinity != other.infinity) { return false; } if (!Objects.equals(this.x, other.x)) { return false; } if (!Objects.equals(this.y, other.y)) { return false; } return true; } Point();  Point(FieldElement x, FieldElement y); static Point createPoint(BigInteger x, BigInteger y, NamedGroup group); static Point createPoint(BigInteger x, BigInteger y, GOSTCurve group); boolean isAtInfinity(); FieldElement getX(); FieldElement getY(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() { BigInteger i1 = new BigInteger("12345678"); BigInteger i2 = new BigInteger("23456789"); BigInteger i3 = new BigInteger("34567891"); BigInteger i4 = new BigInteger("45678912"); BigInteger mod1 = new BigInteger("111111122222"); BigInteger mod2 = new BigInteger("121212121212"); FieldElementFp f1 = new FieldElementFp(i1, mod1); FieldElementFp f2 = new FieldElementFp(i2, mod1); FieldElementFp f3 = new FieldElementFp(i3, mod1); FieldElementFp f4 = new FieldElementFp(i4, mod1); FieldElementFp f1_ = new FieldElementFp(i1, mod2); FieldElementFp f2_ = new FieldElementFp(i2, mod2); Point p1 = new Point(f1, f2); Point p2 = new Point(f3, f4); Point p1_ = new Point(f1_, f2_); assertEquals(p1, p1); assertEquals(p2, p2); assertEquals(p1_, p1_); assertNotEquals(p1, p2); assertNotEquals(p1, p1_); }