code: public UserIdentity toUserIdentity() {
          if (_userIdentity == null) {
              String[] roles = _roles.toArray(new String[_roles.size()]);
  
              _userIdentity = new DefaultUserIdentity(
                      new javax.security.auth.Subject(true, ImmutableSet.of(this), ImmutableSet.of(), ImmutableSet.of()),
                      new BasicUserPrincipal(getId()), roles);
          }
          return _userIdentity;
      }
docs: Returns this instance as a Jetty UserIdentity.  The returned instance is immutable and cached.