### Question:
TransactionProcessorComposite implements TransactionProcessor<V, R> { @Override public boolean isComplete() { for (TransactionProcessor processor : processors) { if (!processor.isComplete()) { return false; } } return true; } TransactionProcessorComposite(ImmutableSet<TransactionProcessor<V, R>> processors); @Override void execute(); @Override boolean isComplete(); @Override ImmutableSet<Exception> getErrors(); @Override Map<V, R> getResults();  }### Answer:
@Test public void testComplete() { for (TransactionProcessor mockProcessor : mockProcessors) { Mockito.when(mockProcessor.isComplete()).thenReturn(true); } Assert.assertTrue(processor.isComplete()); for (TransactionProcessor mockProcessor : mockProcessors) { Mockito.verify(mockProcessor).isComplete(); } }
@Test public void testNotComplete() { Mockito.when(mockProcessors.iterator().next().isComplete()).thenReturn(false); Assert.assertFalse(processor.isComplete()); }