@Test
  public void testRunPluginExtensions_extensionOrder() throws JibPluginExtensionException {
    FooExtension fooExtension =
        new FooExtension(
            (buildPlan, properties, extraConfig, gradleData, logger) ->
                buildPlan.toBuilder().setBaseImage("foo").build());
    BarExtension barExtension =
        new BarExtension(
            (buildPlan, properties, extraConfig, gradleData, logger) ->
                buildPlan.toBuilder().setBaseImage("bar").build());
    loadedExtensions = Arrays.asList(fooExtension, barExtension);

    JibContainerBuilder extendedBuilder1 =
        gradleProjectProperties.runPluginExtensions(
            Arrays.asList(new FooExtensionConfig(), new BarExtensionConfig()), containerBuilder);
    Assert.assertEquals("bar", extendedBuilder1.toContainerBuildPlan().getBaseImage());

    JibContainerBuilder extendedBuilder2 =
        gradleProjectProperties.runPluginExtensions(
            Arrays.asList(new BarExtensionConfig(), new FooExtensionConfig()), containerBuilder);
    Assert.assertEquals("foo", extendedBuilder2.toContainerBuildPlan().getBaseImage());
  }
Plugin extension test for {@link GradleProjectProperties}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesExtensionTest.java