### Question:
JibExtension { public void from(Action<? super BaseImageParameters> action) { action.execute(from); } JibExtension(Project project); void from(Action<? super BaseImageParameters> action); void to(Action<? super TargetImageParameters> action); void container(Action<? super ContainerParameters> action); void extraDirectories(Action<? super ExtraDirectoriesParameters> action); void dockerClient(Action<? super DockerClientParameters> action); void outputPaths(Action<? super OutputPathsParameters> action); void skaffold(Action<? super SkaffoldParameters> action); void pluginExtensions(Action<? super ExtensionParametersSpec> action); void setAllowInsecureRegistries(boolean allowInsecureRegistries); void setContainerizingMode(String containerizingMode); @Nested @Optional BaseImageParameters getFrom(); @Nested @Optional TargetImageParameters getTo(); @Nested @Optional ContainerParameters getContainer(); @Nested @Optional ExtraDirectoriesParameters getExtraDirectories(); @Nested @Optional DockerClientParameters getDockerClient(); @Nested @Optional OutputPathsParameters getOutputPaths(); @Nested @Optional SkaffoldParameters getSkaffold(); @Input @Optional String getContainerizingMode(); @Nested @Optional ListProperty<ExtensionParameters> getPluginExtensions();  }### Answer:
@Test public void testFrom() { Assert.assertNull(testJibExtension.getFrom().getImage()); Assert.assertNull(testJibExtension.getFrom().getCredHelper()); List<PlatformParameters> defaultPlatforms = testJibExtension.getFrom().getPlatforms().get(); Assert.assertEquals(1, defaultPlatforms.size()); Assert.assertEquals("amd64", defaultPlatforms.get(0).getArchitecture()); Assert.assertEquals("linux", defaultPlatforms.get(0).getOs()); testJibExtension.from( from -> { from.setImage("some image"); from.setCredHelper("some cred helper"); from.auth(auth -> auth.setUsername("some username")); from.auth(auth -> auth.setPassword("some password")); from.platforms( platformSpec -> { platformSpec.platform( platform -> { platform.setArchitecture("arm"); platform.setOs("windows"); }); }); }); Assert.assertEquals("some image", testJibExtension.getFrom().getImage()); Assert.assertEquals("some cred helper", testJibExtension.getFrom().getCredHelper()); Assert.assertEquals("some username", testJibExtension.getFrom().getAuth().getUsername()); Assert.assertEquals("some password", testJibExtension.getFrom().getAuth().getPassword()); List<PlatformParameters> platforms = testJibExtension.getFrom().getPlatforms().get(); Assert.assertEquals(1, platforms.size()); Assert.assertEquals("arm", platforms.get(0).getArchitecture()); Assert.assertEquals("windows", platforms.get(0).getOs()); }