### Question:
TransactionInvokerImpl implements TransactionInvoker,TransactionChainListener, Runnable, AutoCloseable { @VisibleForTesting synchronized void recordPendingTransaction(final TransactionCommand command, final ReadWriteTransaction transaction) { pendingTransactions.add(new SimpleImmutableEntry<>(transaction, command)); } 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 testRecordPendingTransaction() { final TransactionInvokerImpl invoker = new TransactionInvokerImpl(db, Collections.emptyList()); final TransactionCommand command = mock(TransactionCommand.class); final ReadWriteTransaction transaction = mock(ReadWriteTransaction.class); invoker.recordPendingTransaction(command, transaction); Queue<Entry<?, ?>> endingTransactions = getInternalState(invoker, "pendingTransactions"); assertEquals(1, endingTransactions.size()); assertSame(transaction, endingTransactions.element().getKey()); assertSame(command, endingTransactions.element().getValue()); }