person.setPersonType("employee", new Employee(system.getEmployeePosition() .get(i), walletWorkNumber, workTimeMap, beginDate, observation, registerDate, dismissedDate, paymentDate, lastCompanyName, lastCompanyAddress, lastCompanyPhone, lastWage, lastJobFunction, lastRegisteredWage, motiveToLeave, ifRegistered, lastJobTime, experiences, knowledgement, finantialInfo, responsableName, responsableRelation, responsableCPF, responsableRG, responsablePhone));
if (userName.equals("")){
person.removePersonType("user");
} else {
User user;
List<Group> groupsList = new ArrayList<Group>();
for (String groupName : groupsNames) {
groupsList.add(system.getGroups().get(groupName));
}
if(person.getPersonType("user") == null) {
user = new User(userName, password, groupsList);
}else{
user = (User)person.getPersonType("user");
user.setPassWord(password);
user.setUserName(userName);
user.getGroups().clear();
user.getGroups().addAll(groupsList);
}
person.setPersonType("user", user);
}
if(!system.getPeople().containsKey(id))//caso ja existir na prevalencia, ja foi alterado no c�digo acima