### Question:
TransactionInvokerImpl implements TransactionInvoker,TransactionChainListener, Runnable, AutoCloseable { @Override public void onTransactionChainFailed(final TransactionChain chainArg, final Transaction transaction, final Throwable cause) { LOG.error("Failed to write operational topology", cause); offerFailedTransaction(transaction); } TransactionInvokerImpl(final DataBroker db); @VisibleForTesting  TransactionInvokerImpl(final DataBroker db, final ExecutorService executor); @VisibleForTesting  TransactionInvokerImpl(final DataBroker db,
            final List<Entry<ReadWriteTransaction, TransactionCommand>> pendingTransactions,
            final List<ReadWriteTransaction> failedTransactions); @VisibleForTesting  TransactionInvokerImpl(final DataBroker db,
            final List<Entry<ReadWriteTransaction, TransactionCommand>> pendingTransactions); @Override void invoke(final TransactionCommand command); @Override void onTransactionChainFailed(final TransactionChain chainArg,
            final Transaction transaction, final Throwable cause); @Override void onTransactionChainSuccessful(final TransactionChain chainArg); @Override void run(); @Override void close();  }### Answer:
@Test public void testOnTransactionChainFailed() { final TransactionInvokerImpl invoker = new TransactionInvokerImpl(db, new ArrayList<>()); final Transaction transaction = mock(Transaction.class); invoker.onTransactionChainFailed(chain, transaction, new Throwable()); final Queue<?> failedQueue = getInternalState(invoker, "failedTransactionQueue"); assertEquals(1, failedQueue.size()); assertTrue(failedQueue.contains(transaction)); }