### Question:
Transaction implements Runnable { public Exception getError() { return worker == null ? null : worker.getError(); } Transaction(TransactionWorker<V, R> worker);  Transaction(V value, TransactionWorker<V, R> worker); boolean isComplete(); V getValue(); R getResult(); Exception getError(); @Override void run();  }### Answer:
@Test public void testError() { Exception exception = new Exception(); Mockito.when(transactionWorker.getError()).thenReturn(exception); Assert.assertEquals(exception, transaction.getError()); }