@Nullable
  @Contract("null -> null")
  private static Sdk findReferencedJdk(Sdk projectSdk) {
    if (projectSdk != null
        && projectSdk.getSdkType() instanceof DependentSdkType
        && projectSdk.getSdkType() instanceof JavaSdkType sdkType) {
      String sdkBinPath = sdkType.getBinPath(projectSdk);
      if (sdkBinPath == null) {
        return null;
      }
      final String jdkPath = FileUtil.toSystemIndependentName(new File(sdkBinPath).getParent());
      return ContainerUtil.find(ProjectJdkTable.getInstance().getAllJdks(), sdk -> {
        final String homePath = sdk.getHomePath();
        return homePath != null && FileUtil.toSystemIndependentName(homePath).equals(jdkPath);
      });
    } else {
      return null;
    }
  }
@Nullable
  @Contract("null -> null")
  private static Sdk findReferencedJdk(Sdk projectSdk)