docs: public static String expandHostNameVariable(String subjectDN, String nodeHostName) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.entry(tc, "expandHostNameVariable", new Object[] { subjectDN, nodeHostName });
  
          String expandedSubjectDN = subjectDN;
          int index1 = subjectDN.indexOf("${hostname}");
  
          if (index1 != -1) {
              String firstPart = subjectDN.substring(0, index1);
              String lastPart = subjectDN.substring(index1 + "${hostname}".length());
              // String.substring always returns non-null
              if (!firstPart.equals("") && !lastPart.equals(""))
                  expandedSubjectDN = firstPart + nodeHostName + lastPart;
              else if (!firstPart.equals(""))
                  expandedSubjectDN = firstPart + nodeHostName;
              else if (!lastPart.equals(""))
                  expandedSubjectDN = nodeHostName + lastPart;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              Tr.exit(tc, "expandHostNameVariable -> " + expandedSubjectDN);
          return expandedSubjectDN;
      }