instance.setArchived(false);
instance.refreshList();
assertTrue(instance.getList().size() > 0);
for (Object object: instance.getList()) {
Volunteer volunteer = (Volunteer) object;
assertTrue("year applying is incorrect, expected " + year + ", found " +
volunteer.getYearApplyingFor(), volunteer.getYearApplyingFor() >= year);
}
instance.setArchived(true);
instance.refreshList();
assertTrue(instance.getList().size() > 0);
boolean isArchivedFound = false;
for (Object object: instance.getList()) {
Volunteer volunteer = (Volunteer) object;
isArchivedFound = (volunteer.getYearApplyingFor() < year);
if (isArchivedFound)
break;
}
assertTrue("Can't find any archived volunteer", isArchivedFound);
}