Object (Object rootElement) { if (!(rootElement instanceof ProjectNode)) return rootElement; ModuleNode effectiveRoot = ((ProjectNode)rootElement).getEffectiveRoot(); return effectiveRoot != null ? effectiveRoot : rootElement; }