TimesheetChangePresenterImplEx extends TimesheetChangePresenterImpl implements HoursChangeObserver { @Override public void startPresenting() { super.startPresenting(); List<Project> projectList = new ArrayList<Project>(); projectList.addAll(projectService.listAllProject(new HashMap<String, Object>(context))); Collections.sort(projectList, new Comparator<Project>() { @Override public int compare(Project o1, Project o2) { return o1.getName().compareTo(o2.getName()); } }); dayPresenters.clear(); for (TimesheetDay day : getTimesheet().getDays()) { TimesheetDayChangePresenterEx dayPresenter = presenterFactory.createTimesheetDayChangePresenter(null); dayPresenter.setTimesheetDay(day); dayPresenter.setProjectList(projectList); dayPresenter.setHoursChangeObserver(this); dayPresenters.add(dayPresenter); dayPresenter.startPresenting(); getView().addTimesheetDayView(dayPresenter.getView()); } for (Project project : projectList) { calculateAndSetProjectSum(project); } } TimesheetChangePresenterImplEx(Map<String, Object> context, PresenterFactoryEx presenterFactory, TimesheetChangeViewEx view, Presenter returnPresenter,
			TimesheetService service, ProjectService projectService);  TimesheetChangePresenterImplEx(Map<String, Object> context, PresenterFactoryEx presenterFactory, TimesheetChangeViewEx view, Presenter returnPresenter,
			SubviewCapablePresenter capablePresenter, TimesheetService service, ProjectService projectService);  TimesheetChangePresenterImplEx(Map<String, Object> context, TimesheetChangeViewEx view,
			Presenter returnPresenter, TimesheetService service); @Override TimesheetChangeViewEx getView(); @Override void startPresenting(); @Override void onSave(); @Override void onRemove(); @Override void hoursChanged(Project project);  }
@SuppressWarnings("unchecked") @Test public void testStartPresenting() { presenterImpl.startPresenting(); verify(view).setObserver(presenterImpl); verify(view).initializeUi(); verify(view).setYear(2014); verify(view).setMonth(7); verify(projectService).listAllProject(anyMap()); verify(presenterFactory, times(2)).createTimesheetDayChangePresenter(null); verify(dayChangePresenter, times(2)).setTimesheetDay(any(TimesheetDay.class)); verify(dayChangePresenter, times(2)).setProjectList(anyListOf(Project.class)); verify(dayChangePresenter, times(2)).setHoursChangeObserver(presenterImpl); verify(dayChangePresenter, times(2)).startPresenting(); verify(view, times(2)).addTimesheetDayView(any(TimesheetDayChangeView.class)); verify(view, times(1)).setProjectSum(eq("test"), floatThat(new BaseMatcher<Float>() { float target = 1.0f + 22.0f / 60.0f; @Override public void describeTo(Description arg0) { arg0.appendText("Roundabout " + target); } @Override public boolean matches(Object arg0) { return Math.abs(((Float) arg0).floatValue() - target) < Float.MIN_NORMAL; } })); }