### Question:
BridgeUtils { public static boolean isFreeBridgeTx(Transaction uscTx, long blockNumber, BlockchainNetConfig netConfig) { UscAddress receiveAddress = uscTx.getReceiveAddress(); if (receiveAddress.equals(UscAddress.nullAddress())) { return false; } BridgeConstants bridgeConstants = netConfig.getCommonConstants().getBridgeConstants(); return PrecompiledContracts.BRIDGE_ADDR.equals(receiveAddress) && netConfig.getConfigForBlock(blockNumber).areBridgeTxsFree() && uscTx.acceptTransactionSignature(netConfig.getCommonConstants().getChainId()) && ( isFromFederateMember(uscTx, bridgeConstants.getGenesisFederation()) || isFromFederationChangeAuthorizedSender(uscTx, bridgeConstants) || isFromLockWhitelistChangeAuthorizedSender(uscTx, bridgeConstants) || isFromFeePerKbChangeAuthorizedSender(uscTx, bridgeConstants) ); }  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 isFreeBridgeTxTrue() { config.setBlockchainConfig(new UnitTestBlockchainNetConfig()); isFreeBridgeTx(true, PrecompiledContracts.BRIDGE_ADDR, BridgeRegTestConstants.getInstance().getFederatorPrivateKeys().get(0).getPrivKeyBytes()); }
@Test public void isFreeBridgeTxOtherContract() { config.setBlockchainConfig(new UnitTestBlockchainNetConfig()); isFreeBridgeTx(false, PrecompiledContracts.IDENTITY_ADDR, BridgeRegTestConstants.getInstance().getFederatorPrivateKeys().get(0).getPrivKeyBytes()); }
@Test public void isFreeBridgeTxFreeTxDisabled() { config.setBlockchainConfig(new RegTestGenesisConfig() { @Override public boolean areBridgeTxsFree() { return false; } }); isFreeBridgeTx(false, PrecompiledContracts.BRIDGE_ADDR, BridgeRegTestConstants.getInstance().getFederatorPrivateKeys().get(0).getPrivKeyBytes()); }
@Test public void isFreeBridgeTxNonFederatorKey() { config.setBlockchainConfig(new UnitTestBlockchainNetConfig()); isFreeBridgeTx(false, PrecompiledContracts.BRIDGE_ADDR, new UldECKey().getPrivKeyBytes()); }