simpleSession.setAttribute(DelegatingSubject.class.getName() + ".RUN_AS_PRINCIPALS_SESSION_KEY",
principalCollectionList);
DelegatingSession delegatingSession =
new DelegatingSession(sessionManager, new DefaultSessionKey(simpleSession.getId()));
// set the user
subject = new DelegatingSubject(new SimplePrincipalCollection("anonymous", "realmName"), true, null,
delegatingSession, securityManager);