public MockTransactionBroadcaster(Wallet wallet){
  lock.lock();
  try {
    this.wallet=wallet;
    wallet.setTransactionBroadcaster(this);
    wallet.getPendingTransactions();
  }
  finally {
    lock.unlock();
  }
}

public MockTransactionBroadcaster ( Wallet wallet ) { lock . lock ( ) ; try { this . wallet = wallet ; wallet . setTransactionBroadcaster ( this ) ; wallet . getPendingTransactions ( ) ; } finally { lock . unlock ( ) ; } }
sets this mock broadcaster on the given wallet .
