public static CloudExtension getCloudExtension() {
    ImmutableList.Builder<CloudExtension> extensionsBuilder = ImmutableList.builder();
    ServiceLoader.load(CloudExtension.class).iterator().forEachRemaining(extensionsBuilder::add);
    ImmutableList<CloudExtension> extensions = extensionsBuilder.build();
    Preconditions.checkState(
        extensions.size() == 1,
        "Exactly one CloudExtension is required, but found " + extensions.size());
    return extensions.get(0);
  }
Helper for loading the cloud extension in a runtime.
portability-spi-cloud/src/main/java/org/datatransferproject/spi/cloud/extension/CloudExtensionLoader.java