### Question:
SigningKey { public byte[] sign(byte[] message) { byte[] signature = Util.prependZeros(SIGNATURE_BYTES, message); int[] bufferLen = new int[1]; sodium().crypto_sign_ed25519(signature, bufferLen, message, message.length, secretKey); signature = Util.slice(signature, 0, SIGNATURE_BYTES); return signature; } SigningKey(byte[] seed);  SigningKey();  SigningKey(String seed, Encoder encoder); VerifyKey getVerifyKey(); byte[] sign(byte[] message); String sign(String message, Encoder encoder); byte[] toBytes(); @Override String toString();  }### Answer:
@Test public void testSignMessageAsBytes() throws Exception { byte[] rawKey = HEX.decode(SIGN_PRIVATE); byte[] signatureRaw = HEX.decode(SIGN_SIGNATURE); SigningKey key = new SigningKey(rawKey); byte[] signedMessage = key.sign(HEX.decode(SIGN_MESSAGE)); assertTrue("Message sign has failed", Arrays.equals(signatureRaw, signedMessage)); }
@Test public void testSignMessageAsHex() throws Exception { SigningKey key = new SigningKey(SIGN_PRIVATE, HEX); String signature = key.sign(SIGN_MESSAGE, HEX); assertEquals("Message sign has failed", SIGN_SIGNATURE, signature); }