static InjectApi from(Elements elementUtils, @Nullable String apiPrefix) {
    ImmutableList<String> apiPackages =
        (apiPrefix == null) ? PREFIXES_IN_ORDER : ImmutableList.of(apiPrefix + ".inject.");
    for (String apiPackage : apiPackages) {
      ImmutableMap<String, TypeElement> apiMap = apiMap(elementUtils, apiPackage);
      TypeElement inject = apiMap.get("Inject");
      TypeElement provider = apiMap.get("Provider");
      TypeElement qualifier = apiMap.get("Qualifier");
      if (inject != null && provider != null && qualifier != null) {
        return new AutoValue_InjectApi(inject, provider, qualifier);
      }
    }
    String classes = "{" + String.join(",", API_CLASSES) + "}";
    String missing = apiPackages.stream().sorted().map(s -> s + classes).collect(joining(" or "));
    throw new IllegalStateException("Class path for AutoFactory class must include " + missing);
  }
Encapsulates the choice of {@code jakarta.inject} or {@code javax.inject}.
factory/src/main/java/com/google/auto/factory/processor/InjectApi.java