void (Consumer<? super CheckedTreeNode> consumer) { final TreeModel treeModel = myTree.getModel(); final Object root = treeModel.getRoot(); if (!(root instanceof CheckedTreeNode)) return; for (TreeNode node : TreeUtil.listChildren((CheckedTreeNode)root)) { if (!(node instanceof CheckedTreeNode)) continue; consumer.consume(((CheckedTreeNode)node)); } }