### Question:
CompositeMonitor implements Monitor { public FluentExecutionStopped exceptionDuringExecution(FluentExecutionStopped ex, WebElement webElement) { FluentExecutionStopped rv = ex; for (Monitor monitor : monitors) { rv = monitor.exceptionDuringExecution(rv, webElement); } return rv; } CompositeMonitor(Monitor... monitors); Timer start(String item); FluentExecutionStopped exceptionDuringExecution(FluentExecutionStopped ex, WebElement webElement);  }### Answer:
@Test public void allAreVisitedWithExceptionAndLastExceptionIsReturned() { FluentExecutionStopped boo = new FluentExecutionStopped("boo", null); FluentExecutionStopped boo2 = new FluentExecutionStopped("boo2", null); WebElement we = mock(WebElement.class); Monitor m1 = mock(Monitor.class); when(m1.exceptionDuringExecution(boo, we)).thenReturn(boo); Monitor m2 = mock(Monitor.class); when(m2.exceptionDuringExecution(boo, we)).thenReturn(boo); Monitor m3 = mock(Monitor.class); when(m3.exceptionDuringExecution(boo, we)).thenReturn(boo2); CompositeMonitor monitor = new CompositeMonitor(m1, m2, m3); FluentExecutionStopped newException = monitor.exceptionDuringExecution(boo, we); assertThat(newException, equalTo(boo2)); verify(m1).exceptionDuringExecution(boo, we); verify(m2).exceptionDuringExecution(boo, we); verify(m3).exceptionDuringExecution(boo, we); }