private static @Nullable Variant detectVariant(Properties p) {
    String implementorVersion = unquoteProperty(p, "IMPLEMENTOR_VERSION");
    if (implementorVersion != null) {
      if (implementorVersion.startsWith("AdoptOpenJDK")) {
        String variant = unquoteProperty(p, "JVM_VARIANT");
        return "OpenJ9".equalsIgnoreCase(variant) ? Variant.AdoptOpenJdk_J9 : Variant.AdoptOpenJdk_HS;
      }
      if (implementorVersion.startsWith("Corretto")) return Variant.Corretto;
      if (implementorVersion.endsWith("-IBM")) return Variant.IBM;
      if (implementorVersion.startsWith("JBR-")) return Variant.JBR;
      if (implementorVersion.startsWith("SapMachine")) return Variant.SapMachine;
      if (implementorVersion.startsWith("Zulu")) return Variant.Zulu;
      if (implementorVersion.startsWith("Homebrew")) return Variant.Homebrew;
    }

    String implementor = unquoteProperty(p, "IMPLEMENTOR");
    if (implementor != null) {
      if (implementor.startsWith("AdoptOpenJDK")) {
        String variant = unquoteProperty(p, "JVM_VARIANT");
        return "OpenJ9".equalsIgnoreCase(variant) ? Variant.AdoptOpenJdk_J9 : Variant.AdoptOpenJdk_HS;
      }

      if (p.getProperty("GRAALVM_VERSION") != null) {
        if (implementor.startsWith("GraalVM")) return Variant.GraalVMCE;
        return Variant.GraalVM;
      }

      return detectVendor(implementor);
    }

    if (p.getProperty("GRAALVM_VERSION") != null) return Variant.GraalVM;

    return null;
  }
private static @Nullable Variant detectVariant(Properties p)