docs: @Override
      public Principal getCallerPrincipal() {
  
          String securityName = null;
          Principal principal = null;
          Subject callerSubject = getCallerSubject();
  
          if (callerSubject == null) {
              return null;
          }
  
          SubjectHelper subjectHelper = new SubjectHelper();
          if (subjectHelper.isUnauthenticated(callerSubject)) {
              return null;
          }
  
          // Here is the order to get the callerPrincipal
          // 1) jsonWebToken in subject
          // 2) From JASPIC property
          // 3) From WSCredential.getSecurityName
          // 4) From WSPrincipal
          // 5) First Principal in Subject
  
          // 1) From jsonWebToken in subject
          Principal jsonWebToken = MpJwtHelper.getJsonWebTokenPricipal(callerSubject);
          if (jsonWebToken != null) {
              return jsonWebToken;
          }
  
          WSCredential wscredential = getWSCredential(callerSubject);
  
          // 2) From JASPIC property
          if (wscredential != null) {
              try {
                  principal = (Principal) wscredential.get("com.ibm.wsspi.security.cred.jaspi.principal");
                  if (principal != null)
                      return principal;
              } catch (Exception e) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Internal error getting JASPIC Principal from credential", e);
                  }
              }
  
              // 3) From WSCredential.getSecurityName
              try {
                  securityName = wscredential.getSecurityName();
              } catch (Exception e) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Error getting securityName from WSCredential", e);
                  }
              }
  
              WSPrincipal wsPrincipal = null;
              if (securityName != null) {
                  Set<WSPrincipal> principals = callerSubject.getPrincipals(WSPrincipal.class);
                  if (!principals.isEmpty()) {
                      wsPrincipal = principals.iterator().next();
                      wsPrincipal = new WSPrincipal(securityName, wsPrincipal.getAccessId(), wsPrincipal.getAuthenticationMethod());
                  }
  
                  if (wsPrincipal != null) {
                      return wsPrincipal;
                  }
              }
  
              // 4) From WSPrincipal
              Set<Principal> principals = callerSubject.getPrincipals();
              if (principals.size() > 0) {
                  for (Iterator<Principal> iterator = principals.iterator(); iterator.hasNext();) {
                      principal = iterator.next();
                      if (principal instanceof WSPrincipal)
                          return principal;
                  }
              }
  
              // There is no WSPrincipal so just return first one
              // 5) First Principal in Subject
              return principals.iterator().next();
          }
  
          return null;
      }