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