@NotNull
  private static ModuleData getOwnerModule(@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;
  }
@NotNull
  private static ModuleData getOwnerModule(@NotNull DataNode<? extends ExternalEntityData> ownerDataNode)