public void newResident(String name) throws AlreadyRegisteredException, NotRegisteredException {
String filteredName;
try {
filteredName = universe.checkAndFilterName(name);
} catch (InvalidNameException e) {
throw new NotRegisteredException(e.getMessage());
}
if (universe.getResidentMap().containsKey(filteredName.toLowerCase()))
throw new AlreadyRegisteredException("A resident with the name " + filteredName + " is already in use.");