public void insert(Employee emp) {
int lastId = 0;
Iterator iter = employees.iterator();
while (iter.hasNext()) {
Employee temp = (Employee)iter.next();
if (temp.getEmployeeId().intValue() > lastId) {
lastId = temp.getEmployeeId().intValue();
}
}
emp.setDepartment((Department)departmentsMap.get(emp.getDepartment().getDepartmentId()));
emp.setEmployeeId(new Integer(lastId + 1));
employees.add(emp);