int (Object parent) { Object group = myGroup; if (myRoot.equals(parent) || group != null && group.equals(parent)) return 1; if (myNode.equals(parent)) return 1; if (myLeaf.equals(parent)) return 0; throw new IllegalStateException(); }