boolean () { GroupNode autoSelectedGroupNode = myAutoSelectedGroupNode; Node selectedNode = getSelectedNode(); if (selectedNode != null) { TreePath expectedPathToBeSelected = autoSelectedGroupNode != null ? TreeUtil.getPathFromRoot(autoSelectedGroupNode) : TreeUtil.getFirstNodePath(myTree); if (!Comparing.equal(TreeUtil.getPathFromRoot(selectedNode), expectedPathToBeSelected)) { return true; } } return false; }