/** * Gets the ids of all sections for group from he scorecard. * * @param group the group for which the sections ids will be collected. * @param scorecard the source scorecard. * @return the set of sections ids for group. */ private static Set getSectionsIds(Group group, Scorecard scorecard) { Set ids = new HashSet(); // get all groups Group[] oldGroups = scorecard.getAllGroups(); for (int i = 0; i < oldGroups.length; i++) { // find the one of given id if (oldGroups[i].getId() == group.getId()) { // get all sections and add the ids to set Section[] sections = oldGroups[i].getAllSections(); for (int j = 0; j < sections.length; j++) { ids.add(new Long(sections[j].getId())); } break; } } return ids; }