### Question:
Sign { public static SignatureData signMessage(byte[] message, ECKeyPair keyPair) { return signMessage(message, keyPair, false); }  static SignatureData signMessage(byte[] message, ECKeyPair keyPair); static SignatureData signMessage(byte[] message, ECKeyPair keyPair, boolean isHash); static BigInteger signedMessageToKey(byte[] message, SignatureData signatureData); static final int SIGN_LENGTH; }### Answer:
@Test public void signMessageTest() { String signResult = "0xc795b2b3c48d370324e5053f4509d4f1f18f80aec4a8cba68ebae922b9f882d845ae312bd84e25eed818ef84e7ed61a774f208fe2b2fe3588b60b4686086208200"; String signature = Numeric.toHexString(Sign.signMessage(message, ecKeyPair).getSignature()); Assertions.assertEquals(signResult, signature); }
@Test public void signMessageForDerFormatTest() { String signResult = "0x3045022100c795b2b3c48d370324e5053f4509d4f1f18f80aec4a8cba68ebae922b9f882d8022045ae312bd84e25eed818ef84e7ed61a774f208fe2b2fe3588b60b46860862082"; String signature = Numeric.toHexString(Sign.signMessage(message, ecKeyPair).getDerSignature()); Assertions.assertEquals(signResult, signature); }