code: public static void mergeNodes(TreeNode master, TreeNode slave) {
          DefaultMutableTreeNode masterNode = (DefaultMutableTreeNode) master;
          DefaultMutableTreeNode slaveNode = (DefaultMutableTreeNode) slave;
  
          int masterCnt = masterNode.getChildCount();
  
          // loop thru the slaves
          while (slaveNode.getChildCount() > 0) {
              DefaultMutableTreeNode slaveNodeChild = (DefaultMutableTreeNode) slaveNode.getFirstChild();
  
              // loop thru the master children
              for (int m = 0; m < masterCnt; m++) {
                  DefaultMutableTreeNode masterAtM = (DefaultMutableTreeNode) masterNode.getChildAt(m);
  
                  if (doCustomMerge(slaveNodeChild, masterAtM)) {
                      slaveNodeChild = null;
                      break;
                  }
  
                  // see if the names are the same
                  if (MergeHelpUtilities.compareNames(masterAtM, slaveNodeChild) == 0) {
                      if (MergeHelpUtilities.haveEqualID(masterAtM, slaveNodeChild)) {
                          // ID and name the same merge the slave node in
                          MergeHelpUtilities.mergeNodes(DEFAULT_MERGE_TYPE, masterAtM, slaveNodeChild);
                          // Need to remove the slaveNodeChild from the list
                          slaveNodeChild.removeFromParent();
                          slaveNodeChild = null;
                          break;
                      }
                      // Names are the same but the ID are not
                      // Mark the nodes and add the slaveChild
                      MergeHelpUtilities.markNodes(masterAtM, slaveNodeChild);
                      masterNode.add(slaveNodeChild);
                      MergeHelpUtilities.mergeNodeChildren(DEFAULT_MERGE_TYPE, slaveNodeChild);
                      slaveNodeChild = null;
                      break;
                  }
              }
              if (slaveNodeChild != null) {
                  masterNode.add(slaveNodeChild);
                  MergeHelpUtilities.mergeNodeChildren(DEFAULT_MERGE_TYPE, slaveNodeChild);
              }
          }
          // There are no more children.
          // Remove slaveNode from it's parent
          slaveNode.removeFromParent();
          slaveNode = null;
      }
docs: MergeHelpUtilities.mergeNode* which is set, using DEFAULT_MERGE_TYPE, to merge with this class instead.