@Test
  public void addJacobianPointsWithEqualXCoordinates_returnsInfinity() throws Exception {
    BigInteger p = EllipticCurvesUtil.getModulus(EllipticCurvesUtil.NIST_P256_PARAMS.getCurve());
    EllipticCurvesUtil.JacobianEcPoint point1 =
        EllipticCurvesUtil.toJacobianEcPoint(
            new ECPoint(
                BigInteger.ZERO,
                new BigInteger(
                    "66485c780e2f83d72433bd5d84a06bb6541c2af31dae871728bf856a174f93f4", 16)),
            p);
    EllipticCurvesUtil.JacobianEcPoint point2 =
        EllipticCurvesUtil.toJacobianEcPoint(
            new ECPoint(
                BigInteger.ZERO,
                new BigInteger(
                    "99b7a386f1d07c29dbcc42a27b5f9449abe3d50de25178e8d7407a95e8b06c0b", 16)),
            p);

    // These points have the same x coordinate, so their sum must be the infinity point.
    EllipticCurvesUtil.JacobianEcPoint output =
        EllipticCurvesUtil.addJacobianPoints(point1, point2, BigInteger.valueOf(3), p);
    assertThat(output.isInfinity()).isTrue();
  }
Unit tests for {@link com.google.crypto.tink.subtle.EllipticCurvesUtil}.
java_src/src/test/java/com/google/crypto/tink/internal/EllipticCurvesUtilTest.java