### Question:
TransactionProcessorPool implements TransactionProcessor<V, R> { public void execute() { ExecutorService executorService = MoreExecutors.sameThreadExecutor(); for (Transaction<V, R> transaction : transactions) { if (!transaction.isComplete()) { executorService.execute(transaction); } } try { executorService.shutdown(); executorService.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { throw new TransfuseTransactionException("Pool executor interrupted", e); } }  void submit(Transaction<V, R> transaction); void execute(); Map<V, R> getResults(); boolean isComplete(); ImmutableSet<Exception> getErrors();  }### Answer:
@Test public void testExecute() { Transaction<String, String> transaction = Mockito.mock(Transaction.class); Mockito.when(transaction.isComplete()).thenReturn(false); pool.submit(transaction); pool.execute(); Mockito.verify(transaction).run(); Assert.assertFalse(pool.isComplete()); }