### Question:
Sign { public static BigInteger signedEIP155MessageToKey(int chainId, byte[] message, SignatureData signatureData) throws SignatureException { byte[] r = signatureData.getR(); byte[] s = signatureData.getS(); verifyPrecondition(r != null && r.length == 32, "r must be 32 bytes"); verifyPrecondition(s != null && s.length == 32, "s must be 32 bytes"); verifyPrecondition(chainId > 0 && chainId < 114, "chainId must be negative number"); int header = signatureData.getV() & 0xFF; header = header - chainId - chainId - 8; if (header < 27) { throw new SignatureException("Header byte out of range: " + header); } ECDSASignature sig = new ECDSASignature( new BigInteger(1, signatureData.getR()), new BigInteger(1, signatureData.getS())); byte[] messageHash = Hash.sha3(message); int recId = header - 27; BigInteger key = recoverFromSignature(recId, sig, messageHash); if (key == null) { throw new SignatureException("Could not recover public key from EIP155 signature"); } return key; }  static SignatureData signEIP155Message(int chainId, byte[] message, ECKeyPair keyPair); static SignatureData signMessage(byte[] message, ECKeyPair keyPair); static SignatureData signMessage(byte[] message, ECKeyPair keyPair, boolean needToHash); static BigInteger recoverFromSignature(int recId, ECDSASignature sig, byte[] message); static BigInteger signedMessageToKey(
            byte[] message, SignatureData signatureData); static BigInteger signedEIP155MessageToKey(int chainId,
            byte[] message, SignatureData signatureData); static BigInteger publicKeyFromPrivate(BigInteger privKey);  }### Answer:
@Test public void testSignedEIP155MessageToKey() throws SignatureException { int chainId = 100; Sign.SignatureData signatureData = Sign.signEIP155Message(chainId, TEST_MESSAGE, SampleKeys.KEY_PAIR); BigInteger key = Sign.signedEIP155MessageToKey(chainId, TEST_MESSAGE, signatureData); assertThat(key, equalTo(SampleKeys.PUBLIC_KEY)); }