public function populate($username, $password, array $roles, $isAuthenticated = false)
    {
        // store general data
        $this->username = $username;
        $this->password = $password;
        $this->isAuthenticated = $isAuthenticated;

        $this->roles = $this->arr([]);
        foreach ($roles as $r) {
            if($this->isInstanceOf($r, Role::class)) {
                $this->roles->append($r);
            } else {
                $this->roles->append(new Role($r));
            }
        }

        // append anonymous role
        $this->roles->append(new Role('ROLE_ANONYMOUS'));
    }