docs: @Override
      public Subject finalizeSubject(Subject subject, ConnectionRequestInfo reqInfo, CMConfigData cmConfigData) throws ResourceException {
          if (tc.isEntryEnabled())
              Tr.entry(this, tc, "finalizeSubject", getSubjectString(subject), reqInfo);
  
          Subject helperSubject = subject; // To start, default helper subject to the input subject
  
          if (cmConfigData.getAuth() == J2CConstants.AUTHENTICATION_CONTAINER) {
              // resauth=Container, so continue.
  
              if (m_ThreadIdentitySupport == AbstractConnectionFactoryService.THREAD_IDENTITY_ALLOWED) {
  
                  // The current resource adapter MCF Configuration supports
                  // using ThreadIdentity.
  
                  // Check if a container-managed alias is configured.  If yes, the alias
                  // will be used.  If no, then use the invocation subject.
                  String containerAlias = getAliasToFinalize(cmConfigData);
                  if (containerAlias == null || containerAlias.equals("")) {
  
                      // No Container-managed alias was specified.
                      // Additionally, the resource adapter supports
                      // using the user associated with the current
                      // thread as the user identity that is to be
                      // associated with the connection. In this case
                      // we will default the Subject to a valid Subject
                      // that represents the user associated with the
                      // current thread and it will contain a UTOKEN
                      // Generic Credential in its set of private
                      // credentials. This type of credential is what
                      // triggers an adapter to know it is using the
                      // user identity associated with the current thread
                      // as the user to be associated with the connection.
  
                      helperSubject = getJ2CInvocationSubject();
  
                      if (tc.isDebugEnabled()) {
                          Tr.debug(tc, "finalizeSubject(): No user identity was specifed. User identity has been defaulted to current thread identity");
                      }
                  }
  
              } else if (m_ThreadIdentitySupport == AbstractConnectionFactoryService.THREAD_IDENTITY_REQUIRED) {
  
                  // The connector this helper is associated with
                  // always requires that the user associated with
                  // the current thread is to be used as the identity
                  // associated with the connection. In this case,
                  // we will set the Subject to a valid Subject
                  // that represents the user associated with the
                  // current thread and it will contain a UTOKEN
                  // Generic Credential in its set of private
                  // credentials. This type of credential is what
                  // triggers the adapter to know it is using the
                  // user identity associated with the current thread
                  // as the user to be associated with the connection.
                  //
                  // NOTE: in this case, the user identity that may be
                  //       specified by a Container-managed alias will
                  //       be ignored/overridden.
  
                  helperSubject = getJ2CInvocationSubject();
  
                  if (tc.isDebugEnabled()) {
                      Tr.debug(tc, "finalizeSubject(): Connector REQUIRED specified user identity to be overridden by the current thread identity");
                  }
              }
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(this, tc, "finalizeSubject", getSubjectString(helperSubject));
          return helperSubject;
      }