protected function checkUserHasRole($user, string $role): bool
    {
        if (! in_array($role, $user->roles, true)) {
            $message = sprintf(
                '[W804] User with login: %s exists, but role %s is not in the list of applied roles: %s',
                $user->user_login,
                $role,
                $user->roles
            );
            throw new \UnexpectedValueException($message);
        }

        return true;
    }