public static byte[] signMessage(RawTransaction rawTransaction, Credentials credentials) {
        byte[] encodedTransaction;
        if (rawTransaction.getTransaction().getType().isEip4844()) {
            encodedTransaction = encode4844(rawTransaction);
        } else {
            encodedTransaction = encode(rawTransaction);
        }
        Sign.SignatureData signatureData =
                Sign.signMessage(encodedTransaction, credentials.getEcKeyPair());

        return encode(rawTransaction, signatureData);
    }
@Test
    public void testSignMessageAfterEip155() {
        byte[] signedMessage =
                TransactionEncoder.signMessage(
                        createEip155RawTransaction(),
                        ChainId.MAIN_NET.getId(),
                        SampleKeys.CREDENTIALS_ETH_EXAMPLE);

        String hexMessage = Numeric.toHexString(signedMessage);
        assertEquals(SIGN_RESULT_ETH_EXAMPLE, hexMessage);
    }