public void setSpecialAttribute(Attribute attribute, String specialName) { AttributeRole oldRole = findRoleBySpecialName(specialName); if (oldRole != null) { remove(oldRole); } if (attribute != null) { remove(attribute); AttributeRole role = new AttributeRole(attribute); role.setSpecial(specialName); ; add(role); } }