code: protected void updatePredecessorsWithCheckMode(TreePath tp, boolean check) {
          TreePath parentPath = tp.getParentPath();
          // If it is the root, stop the recursive calls and return
          if (parentPath == null) {
              return;
          }       
          CheckedNode parentCheckedNode = nodesCheckingState.get(parentPath);
          DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) parentPath.getLastPathComponent();     
          parentCheckedNode.allChildrenSelected = true;
          parentCheckedNode.isSelected = false;
          for (int i = 0 ; i < parentNode.getChildCount() ; i++) {                
              TreePath childPath = parentPath.pathByAddingChild(parentNode.getChildAt(i));
              CheckedNode childCheckedNode = nodesCheckingState.get(childPath);           
              // It is enough that even one subtree is not fully selected
              // to determine that the parent is not fully selected
              if (!allSelected(childCheckedNode)) {
                  parentCheckedNode.allChildrenSelected = false;      
              }
              // If at least one child is selected, selecting also the parent
              if (childCheckedNode.isSelected) {
                  parentCheckedNode.isSelected = true;
              }
          }
          if (parentCheckedNode.isSelected) {
              checkedPaths.add(parentPath);
          } else {
              checkedPaths.remove(parentPath);
          }
          // Go to upper predecessor
          updatePredecessorsWithCheckMode(parentPath, check);
      }
docs: When a node is checked/unchecked, updating the states of the predecessors