@Test
public void testFromMessageAndKeyPair() throws InvalidAlgorithmParameterException,
        NoSuchAlgorithmException, NoSuchProviderException {

    byte[] message = new byte[10];
    Arrays.fill(message, (byte) 10);
    ECKeyPair keyPair = ECKeyPair.createEcKeyPair();
    InvocationScript invScript = InvocationScript.fromMessageAndKeyPair(message, keyPair);
    byte[] expectedSignature = Sign.signMessage(message, keyPair).getConcatenated();
    String expected = ""
            + OpCode.PUSHDATA1.toString() + "40" // 64 bytes of signature
            + Numeric.toHexStringNoPrefix(expectedSignature); // signature
    assertArrayEquals(Numeric.hexStringToByteArray(expected), invScript.getScript());
}