### Question:
Ed25519KeyGenerator implements KeyGenerator { @Override public PublicKey derivePublicKey(final PrivateKey privateKey) { final Ed25519EncodedFieldElement a = Ed25519Utils.prepareForScalarMultiply(privateKey); final Ed25519GroupElement pubKey = Ed25519Group.BASE_POINT.scalarMultiply(a); return new PublicKey(pubKey.encode().getRaw()); }  @Override KeyPair generateKeyPair(); @Override PublicKey derivePublicKey(final PrivateKey privateKey);  }### Answer:
@Test public void derivePublicKey() { final KeyGenerator generator = this.getKeyGenerator(); final KeyPair keyPair = KeyPair.fromPrivate( PrivateKey.fromHexString( "787225aaff3d2c71f4ffa32d4f19ec4922f3cd869747f267378f81f8e3fcb12d")); final PublicKey publicKey = generator.derivePublicKey(keyPair.getPrivateKey()); final PublicKey expected = PublicKey.fromHexString("2134E47AEE6F2392A5B3D1238CD7714EABEB739361B7CCF24BAE127F10DF17F2"); MatcherAssert.assertThat(publicKey, IsEqual.equalTo(expected)); }