### Question:
CompositeMonitor implements Monitor { public Timer start(String item) { for (Monitor monitor : monitors) { Timer foo = monitor.start(item); if (!(foo instanceof Timer.NULL)) { return foo; } } return monitors[0].start(item); } CompositeMonitor(Monitor... monitors); Timer start(String item); FluentExecutionStopped exceptionDuringExecution(FluentExecutionStopped ex, WebElement webElement);  }### Answer:
@Test public void onlyOneTimerIsStarted() { Monitor m1 = mock(Monitor.class); when(m1.start("foo")).thenReturn(new Monitor.Timer.NULL()); Monitor m2 = mock(Monitor.class); Monitor.Timer t2 = mock(Monitor.Timer.class); when(m2.start("foo")).thenReturn(t2); Monitor m3 = mock(Monitor.class); when(m3.start("foo")).thenReturn(new Monitor.Timer.NULL()); CompositeMonitor monitor = new CompositeMonitor(m1, m2, m3); Monitor.Timer chosenTimer = monitor.start("foo"); assertThat(chosenTimer, equalTo(t2)); }