ModuleData (@NotNull DataNode<? extends ExternalEntityData> ownerDataNode) { ModuleData result = null; ExternalEntityData ownerData = ownerDataNode.getData(); if (ownerData instanceof ModuleData moduleData) { result = moduleData; } else if (ownerData instanceof DependencyData<?> dependencyData) { result = dependencyData.getOwnerModule(); } assert result != null; return result; }