public function createUser($username, $password, $mail, User $parent=null)
    {
        $user = new UserImpl($this->container, $username);
        if (!$user->setMail($mail) || !$user->setPassword($password) ) {
            return false;
        }

        if($parent != null && !$user->setParent($parent->getUsername())){
            return false;
        }

        if(!$user->create()){
            return false;
        }

        $this->userList[$user->getUsername()] = $user;
        $user->attachObserver($this);
        $this->setUpIterator();
        return $user;
    }