code: private boolean doesSubjectContainUTOKEN(Subject subj) throws ResourceException {
  
          Set privateGenericCredentials = getPrivateGenericCredentials(subj);
          final Iterator iter = privateGenericCredentials.iterator();
  
          boolean subjectHasUtokenCred = false;
          GenericCredential credential = null;
  
          while (iter.hasNext()) {
              if (System.getSecurityManager() != null) {
                  try {
                      credential = (GenericCredential) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                          @Override
                          public Object run() throws Exception {
                              return iter.next();
                          }
                      });
                  } catch (java.security.PrivilegedActionException pae) {
                      FFDCFilter.processException(pae, "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection", "19", this);
                      Tr.error(tc, "FAILED_DOPRIVILEGED_J2CA0060", pae);
                      Exception e = pae.getException();
                      ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to access Subject's credentials");
                      re.initCause(e);
                      throw re;
                  }
  
              } else {
                  credential = (GenericCredential) iter.next();
              }
  
              if (credential.getMechType().equals("oid:1.3.18.0.2.30.1")) {
                  subjectHasUtokenCred = true;
                  break;
              }
          }
          return subjectHasUtokenCred;
      }
docs: Search for a GenericCredential representing a native z/OS UTOKEN in the
  Subject's set of private credentials. It would have been put there by
  a previous call to finalizeSubject.
  
  @return true if the subject contains a UTOKEN; false otherwise.