List<Annotation> annotationsExpectedToBeUsedInYearly) {
YearlyReportViewModel yearlyReportViewModel = new YearlyReportViewModel();
yearlyReportViewModel.updateBookSelection(BookSelection
.fromBook(propertyBook));
yearlyReportViewModel.setYearlyReportYear(2012);
AnnotationDateYearlyGroupingModel annotationsDateYearlyGroupingModel = yearlyReportViewModel
.getAnnotationsDateYearlyGroupingModel();
Integer numberOfGroups = annotationsDateYearlyGroupingModel
.getGroupCount();
// we expect 1 property (the one selected)
Assert.assertEquals(new Integer(1), numberOfGroups);
for (Integer currentProperty = 0; currentProperty < numberOfGroups; currentProperty++) {
List<Annotation> annotationsForProperty = new LinkedList<Annotation>();
for (Integer annotationIndex = 0; annotationIndex < annotationsDateYearlyGroupingModel
.getChildCount(currentProperty); annotationIndex++) {
Annotation currentAnnotation = annotationsDateYearlyGroupingModel.getChild(
currentProperty, annotationIndex);
annotationsForProperty.add(currentAnnotation);
}
Assert.assertTrue(annotationsForProperty
.containsAll(annotationsExpectedToBeUsedInYearly));