private JibGradlePluginExtension<?> findConfiguredExtension(
      List<JibGradlePluginExtension<?>> extensions, ExtensionConfiguration config)
      throws JibPluginExtensionException {
    Predicate<JibGradlePluginExtension<?>> matchesClassName =
        extension -> extension.getClass().getName().equals(config.getExtensionClass());
    Optional<JibGradlePluginExtension<?>> found =
        extensions.stream().filter(matchesClassName).findFirst();
    if (!found.isPresent()) {
      throw new JibPluginExtensionException(
          NullExtension.class,
          "extension configured but not discovered on Jib runtime classpath: "
              + config.getExtensionClass());
    }
    return found.get();
  }
Returns the input files for a task. These files include the gradle {@link
org.gradle.api.artifacts.Configuration}, output directories (classes, resources, etc.) of the
main {@link org.gradle.api.tasks.SourceSet}, and any extraDirectories defined by the user to
include in the container.

@param project the gradle project
@param extraDirectories the image's configured extra directories
@return the input files
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java