@Test
  public void addJacobianPointsWithInfinity() throws Exception {
    BigInteger p = EllipticCurvesUtil.getModulus(EllipticCurvesUtil.NIST_P256_PARAMS.getCurve());
    EllipticCurvesUtil.JacobianEcPoint inf =
        EllipticCurvesUtil.toJacobianEcPoint(ECPoint.POINT_INFINITY, p);
    ECPoint point =
        new ECPoint(
            new BigInteger("700c48f77f56584c5cc632ca65640db91b6bacce3a4df6b42ce7cc838833d287", 16),
            new BigInteger("db71e509e3fd9b060ddb20ba5c51dcc5948d46fbf640dfe0441782cab85fa4ac", 16));
    EllipticCurvesUtil.JacobianEcPoint jpoint = EllipticCurvesUtil.toJacobianEcPoint(point, p);
    assertThat(
            EllipticCurvesUtil.addJacobianPoints(jpoint, inf, BigInteger.valueOf(3), p)
                .toECPoint(p))
        .isEqualTo(point);
    assertThat(
            EllipticCurvesUtil.addJacobianPoints(inf, jpoint, BigInteger.valueOf(3), p)
                .toECPoint(p))
        .isEqualTo(point);
    EllipticCurvesUtil.JacobianEcPoint inf2 =
        EllipticCurvesUtil.addJacobianPoints(inf, inf, BigInteger.valueOf(3), p);
    assertThat(inf2.isInfinity()).isTrue();
  }
Unit tests for {@link com.google.crypto.tink.subtle.EllipticCurvesUtil}.
java_src/src/test/java/com/google/crypto/tink/internal/EllipticCurvesUtilTest.java