CompositeMonitoringView implements MonitoringView { @Override public void startMonitoring(Collection<Monitorable<?>> monitorables) { for (MonitoringView monitoringView : monitoringViews) { monitoringView.startMonitoring(monitorables); } } CompositeMonitoringView(MonitoringView... monitoringViews); @Override void startMonitoring(Collection<Monitorable<?>> monitorables); @Override void stopMonitoring(Collection<Monitorable<?>> monitorables); @Override /** * For a Composite view, isRunning() is true if any of the underlying views are still running */ boolean isRunning();  }
@Test public void startMonitoringShouldStartAllViews() { compositeMonitoringView.startMonitoring(monitorables); verify(monitoringView1).startMonitoring(monitorables); verify(monitoringView2).startMonitoring(monitorables); }