}
@Test
@SuppressWarnings("unchecked")
public void theRightAggregatedHoursGroupsAreCreated() {
HoursGroup h1 = createHoursGroupWithCriterions(criterion1, criterion2);
HoursGroup h2 = createHoursGroupWithCriterions(criterion1);
HoursGroup h3 = createHoursGroupWithCriterions(criterion2, criterion1);
HoursGroup h4 = createHoursGroupWithCriterions(criterion2);
HoursGroup h5 = createHoursGroupWithCriterions(criterion2);
List<AggregatedHoursGroup> aggregates = AggregatedHoursGroup.aggregate(
h1, h2, h3, h4, h5);
assertThat(aggregates.size(), equalTo(3));
assertThat(aggregates, hasItem(allOf(withCriterions(criterion1,
criterion2), withHours(h1, h3))));