for (Object element : elements) {
Item entry = null;
/* Entity Group */
if (element instanceof EntityGroup) {
EntityGroup group = (EntityGroup) element;
entry = new Group(group.getId());
fGroupMap.put(entry.getId(), (Group) entry);
currentGroupEntryList = new ArrayList<Long>();
fEntityGroupToNewsMap.put(group.getId(), currentGroupEntryList);
/*
* We use ">=" here to check if the group is visible or not to avoid the case
* of a group being made visible that contains no visible news at all.
*/
if (pageSize != 0 && newsCounter >= pageSize)
setGroupVisible(group.getId(), false);
}
/* News Item */
else if (element instanceof INews) {
newsCounter++;