code: protected void setUpSubject() throws LoginException {
          try {
              AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
                  @Override
                  public Object run() throws Exception {
                      updateSubjectWithSharedStateContents();
                      updateSubjectWithTemporarySubjectContents();
                      optionallySetWSCredentialExpiration();
                      return null;
                  }
              });
          } catch (PrivilegedActionException e) {
              throw new LoginException("Unable to setup the Subject: " + e.getLocalizedMessage());
          }
      }
docs: Commit the newly created elements into the original Subject.