BigIntegerFieldElement implements FieldElement { @Override public FieldElement modInverse() { return create(value.modInverse(getModulus())); } private  BigIntegerFieldElement(BigInteger value, BigIntegerModulus modulus); @Override FieldElement add(FieldElement operand); @Override FieldElement subtract(FieldElement operand); @Override FieldElement negate(); @Override FieldElement multiply(FieldElement operand); @Override FieldElement sqrt(); @Override FieldElement modInverse(); @Override String toString();  }
@Test public void modInverse() { BigInteger result1 = BigIntegerFieldElement .extractValue(BigIntegerFieldElement.create(1, modulus).modInverse()); BigInteger result2 = BigIntegerFieldElement .extractValue(BigIntegerFieldElement.create(27, modulus).modInverse()); BigInteger result3 = BigIntegerFieldElement .extractValue(BigIntegerFieldElement.create(56, modulus).modInverse()); BigInteger result4 = BigIntegerFieldElement .extractValue(BigIntegerFieldElement.create(77, modulus).modInverse()); BigInteger result5 = BigIntegerFieldElement .extractValue(BigIntegerFieldElement.create(112, modulus).modInverse()); assertThat(result1, Is.is(BigInteger.valueOf(1))); assertThat(result2, Is.is(BigInteger.valueOf(67))); assertThat(result3, Is.is(BigInteger.valueOf(111))); assertThat(result4, Is.is(BigInteger.valueOf(91))); assertThat(result5, Is.is(BigInteger.valueOf(112))); }