### Question:
TimesheetDayChangePresenterImplEx extends TimesheetDayChangePresenterImpl implements TimesheetDayChangePresenterEx,
		TimesheetDayChangeViewEx.Observer, HoursChangeObserver { @Override public boolean validateFields() { boolean valid = true; valid = valid && getView().checkAllFieldsValid(); for (TimesheetDayEntryChangePresenterEx entryPresenter : entryPresenters) { valid = valid && entryPresenter.validateFields(); } return valid; } TimesheetDayChangePresenterImplEx(Map<String, Object> context, PresenterFactoryEx presenterFactory, TimesheetDayChangeViewEx view, Presenter returnPresenter,
			TimesheetDayService service);  TimesheetDayChangePresenterImplEx(Map<String, Object> context, PresenterFactoryEx presenterFactory, TimesheetDayChangeViewEx view, Presenter returnPresenter,
			SubviewCapablePresenter capablePresenter, TimesheetDayService service);  TimesheetDayChangePresenterImplEx(Map<String, Object> context,
			TimesheetDayChangeViewEx view, Presenter returnPresenter,
			TimesheetDayService service); @Override TimesheetDayChangeViewEx getView(); @Override void startPresenting(); @Override void loadFromModel(); @Override boolean validateFields(); @Override void saveToModel(); @Override void onAdditionalEntry(); @Override void onSave(); @Override void onCancel(); @Override void onRemove(); @Override List<Project> getProjectList(); @Override void setProjectList(List<Project> projectList); @Override void setHoursChangeObserver(HoursChangeObserver observer); @Override void hoursChanged(Project project);  }### Answer:
@Test public void testValidateFields() { List<TimesheetDayEntryChangePresenterEx> entryPresenters = new ArrayList<TimesheetDayEntryChangePresenterEx>(); entryPresenters.add(entryChangePresenter); entryPresenters.add(entryChangePresenter); entryPresenters.add(entryChangePresenter); presenterImpl.entryPresenters = entryPresenters; when(view.checkAllFieldsValid()).thenReturn(true); when(entryChangePresenter.validateFields()).thenReturn(true); boolean res = presenterImpl.validateFields(); assertTrue(res); verify(view).checkAllFieldsValid(); verify(entryChangePresenter, times(3)).validateFields(); }
@Test public void testValidateFieldsNotValid() { List<TimesheetDayEntryChangePresenterEx> entryPresenters = new ArrayList<TimesheetDayEntryChangePresenterEx>(); entryPresenters.add(entryChangePresenter); entryPresenters.add(entryChangePresenter); entryPresenters.add(entryChangePresenter); presenterImpl.entryPresenters = entryPresenters; when(view.checkAllFieldsValid()).thenReturn(true); when(entryChangePresenter.validateFields()).thenReturn(false); boolean res = presenterImpl.validateFields(); assertFalse(res); verify(view).checkAllFieldsValid(); verify(entryChangePresenter, times(1)).validateFields(); }