### Question:
BridgeUtils { public static Address recoverUldAddressFromEthTransaction(org.ethereum.core.Transaction tx, NetworkParameters networkParameters) { org.ethereum.crypto.ECKey key = tx.getKey(); byte[] pubKey = key.getPubKey(true); return UldECKey.fromPublicOnly(pubKey).toAddress(networkParameters); }  static StoredBlock getStoredBlockAtHeight(UldBlockstoreWithCache blockStore, int height); static Wallet getFederationNoSpendWallet(Context uldContext, Federation federation); static Wallet getFederationsNoSpendWallet(Context uldContext, List<Federation> federations); static Wallet getFederationSpendWallet(Context uldContext, Federation federation, List<UTXO> utxos); static Wallet getFederationsSpendWallet(Context uldContext, List<Federation> federations, List<UTXO> utxos); static boolean isValidLockTx(UldTransaction tx); static Optional<Script> getFirstInputScriptSig(UldTransaction tx); static boolean isLockTx(UldTransaction tx, List<Federation> federations, Context uldContext, BridgeConstants bridgeConstants); static boolean isLockTx(UldTransaction tx, Federation federation, Context uldContext, BridgeConstants bridgeConstants); static boolean isReleaseTx(UldTransaction tx, List<Federation> federations); static boolean isMigrationTx(UldTransaction uldTx, Federation activeFederation, Federation retiringFederation, Context uldContext, BridgeConstants bridgeConstants); static Address recoverUldAddressFromEthTransaction(org.ethereum.core.Transaction tx, NetworkParameters networkParameters); static boolean isFreeBridgeTx(Transaction uscTx, long blockNumber, BlockchainNetConfig netConfig); static boolean isContractTx(Transaction uscTx); static boolean isFromFederateMember(org.ethereum.core.Transaction uscTx, Federation federation);  }### Answer:
@Test public void getAddressFromEthTransaction() { org.ethereum.core.Transaction tx = org.ethereum.core.Transaction.create(config, TO_ADDRESS, AMOUNT, NONCE, GAS_PRICE, GAS_LIMIT, DATA); byte[] privKey = generatePrivKey(); tx.sign(privKey); Address expectedAddress = UldECKey.fromPrivate(privKey).toAddress(RegTestParams.get()); Address result = BridgeUtils.recoverUldAddressFromEthTransaction(tx, RegTestParams.get()); assertEquals(expectedAddress, result); }
@Test(expected = Exception.class) public void getAddressFromEthNotSignTransaction() { org.ethereum.core.Transaction tx = org.ethereum.core.Transaction.create(config, TO_ADDRESS, AMOUNT, NONCE, GAS_PRICE, GAS_LIMIT, DATA); BridgeUtils.recoverUldAddressFromEthTransaction(tx, RegTestParams.get()); }