Sign { public static SignatureData signMessage(byte[] message, ECKeyPair keyPair) { return signMessage(message, keyPair, true); }  static SignatureData signMessage(byte[] message, ECKeyPair keyPair); static SignatureData signMessage(byte[] message, ECKeyPair keyPair, boolean needToHash); static ECPublicKey recoverFromSignature(int recId, ECDSASignature sig, byte[] message); static ECPublicKey signedMessageToKey(
            byte[] message, SignatureData signatureData); static ECPublicKey publicKeyFromPrivate(ECPrivateKey privKey); static ECPoint publicPointFromPrivateKey(ECPrivateKey privKey); static String recoverSigningAddress(byte[] message, SignatureData signatureData);  }
@Test public void testSignMessage() { Sign.SignatureData signatureData = Sign.signMessage(TEST_MESSAGE, KEY_PAIR); Sign.SignatureData expected = new Sign.SignatureData( (byte) 27, Numeric.hexStringToByteArray( "147e5f3c929dd830d961626551dbea6b70e4b2837ed2fe9089eed2072ab3a655"), Numeric.hexStringToByteArray( "523ae0fa8711eee4769f1913b180b9b3410bbb2cf770f529c85f6886f22cbaaf") ); assertThat(signatureData, is(expected)); }