Tests for StateGuard.