### Question:
JibExtension { public void to(Action<? super TargetImageParameters> action) { action.execute(to); } 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 testTo() { Assert.assertNull(testJibExtension.getTo().getImage()); Assert.assertNull(testJibExtension.getTo().getCredHelper()); testJibExtension.to( to -> { to.setImage("some image"); to.setCredHelper("some cred helper"); to.auth(auth -> auth.setUsername("some username")); to.auth(auth -> auth.setPassword("some password")); }); Assert.assertEquals("some image", testJibExtension.getTo().getImage()); Assert.assertEquals("some cred helper", testJibExtension.getTo().getCredHelper()); Assert.assertEquals("some username", testJibExtension.getTo().getAuth().getUsername()); Assert.assertEquals("some password", testJibExtension.getTo().getAuth().getPassword()); }