docs: public String switchToLdapNode(String uniqueName) {
          if (uniqueName == null || !iNeedSwitchNode) {
              return uniqueName;
          }
          StringBuffer DNBuf = new StringBuffer(uniqueName);
          String uniqueNameForCompare = uniqueName.toLowerCase();
          // The LDAP node this DN is under.
          String ldapNode = null;
          // Replace node in the DN.
          for (int i = 0, n = iNodesForCompare.length; i < n; i++) {
              int pos = uniqueNameForCompare.lastIndexOf(iNodesForCompare[i]);
              if (pos > -1) {
                  // If pos is 0 and the node is not empty node, means the DN is one of the iNodes, just simply return.
                  if (pos == 0) {
                      if (iNodesForCompare[i].length() > 0 && iNodesForCompare[i].length() == uniqueName.length()) {
                          return iLdapNodes[i];
                      } else {
                          //Everyting is under empty node.
                          if (iLdapNodes[i].length() > 0) {
                              ldapNode = "," + iLdapNodes[i];
                          } else {
                              ldapNode = iLdapNodes[i];
                          }
                      }
                  } else {
                      if (uniqueName.length() - pos == iNodesForCompare[i].length()) {
                          ldapNode = iLdapNodes[i];
                          // if nameInRepository is root("") node, then strip off the "," too.
                          if (ldapNode != null && ldapNode.length() == 0 && (DNBuf.charAt(pos - 1) == ',')) {
                              DNBuf = new StringBuffer(DNBuf.substring(0, pos - 1));
                          } else {
                              DNBuf = new StringBuffer(DNBuf.substring(0, pos));
                          }
                          break;
                      }
                  }
              }
          }
  
          if (ldapNode != null) {
              DNBuf.append(ldapNode);
          }
          return DNBuf.toString();
      }