### Question:
Ed25519FieldElement implements Serializable { public int[] getRaw() { return this.values; } Ed25519FieldElement(final int[] values); static Ed25519FieldElement sqrt(final Ed25519FieldElement u, final Ed25519FieldElement v); int[] getRaw(); boolean isNonZero(); Ed25519FieldElement add(final Ed25519FieldElement g); Ed25519FieldElement subtract(final Ed25519FieldElement g); Ed25519FieldElement negate(); Ed25519FieldElement multiply(final Ed25519FieldElement g); Ed25519FieldElement square(); Ed25519FieldElement squareAndDouble(); Ed25519FieldElement invert(); Ed25519EncodedFieldElement encode(); boolean isNegative(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }### Answer:
@Test public void canCreateFieldElementFromArrayWithCorrectLength() { Ed25519FieldElement element = new Ed25519FieldElement(new int[10]); Assertions.assertEquals(10, element.getRaw().length); }
@Test public void getRawReturnsUnderlyingArray() { final int[] values = new int[10]; values[0] = 5; values[6] = 15; values[8] = -67; final Ed25519FieldElement f = new Ed25519FieldElement(values); MatcherAssert.assertThat(values, IsEqual.equalTo(f.getRaw())); }
@Test public void decodeReturnsCorrectFieldElement() { for (int i = 0; i < 10000; i++) { final byte[] bytes = RandomUtils.generateRandomBytes(32); bytes[31] = (byte) (bytes[31] & 0x7f); final BigInteger b1 = MathUtils.toBigInteger(bytes); final Ed25519FieldElement f = new Ed25519EncodedFieldElement(bytes).decode(); final BigInteger b2 = MathUtils.toBigInteger(f.getRaw()).mod(Ed25519Field.P); MatcherAssert.assertThat(b2, IsEqual.equalTo(b1)); } }