@Override public void removeUsers(User user) { if (user.isRoot() || user.isGuest()) { throw new IllegalRemovalException("You can't remove " + user.getName()); } else { super.removeUsers(user); } }
protected void removeUsers(String username) throws IllegalRemovalException, UserUnknownException { hasUser(username); if (username.equals(ROOT_USER)) throw new IllegalRemovalException(username); else { User toRemove = getUserByUsername(username); toRemove.remove(); super.removeUsers(toRemove); } }