skillList = new ArrayList<Skill>(skillElementList.size());
skillMap = new HashMap<String, Skill>(skillElementList.size());
long id = 0L;
for (Element element : skillElementList) {
assertElementName(element, "Skill");
Skill skill = new Skill();
skill.setId(id);
skill.setCode(element.getText());
skillList.add(skill);
if (skillMap.containsKey(skill.getCode())) {
throw new IllegalArgumentException("There are 2 skills with the same code ("
+ skill.getCode() + ").");
}
skillMap.put(skill.getCode(), skill);
id++;
}
}
nurseRoster.setSkillList(skillList);
}