ModuleNode (PackageDependenciesNode node) { if (node instanceof ModuleNode) return (ModuleNode)node; if (node == null || node instanceof RootNode) return null; return getModuleParent((PackageDependenciesNode)node.getParent()); }