boolean (CheckedTreeNode root) { Object userObject = root.getUserObject(); if (userObject instanceof IntentionActionMetaData metaData) { Boolean b = myIntentionToCheckStatus.get(metaData); boolean enabled = b == Boolean.TRUE; root.setChecked(enabled); return enabled; } else { root.setChecked(false); visitChildren(root, new CheckedNodeVisitor() { @Override public void visit(CheckedTreeNode node) { if (resetCheckMark(node)) { root.setChecked(true); } } }); return root.isChecked(); } }