### Question:
JibExtension { public void extraDirectories(Action<? super ExtraDirectoriesParameters> action) { action.execute(extraDirectories); } 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 testExtraDirectories() { testJibExtension.extraDirectories( extraDirectories -> { extraDirectories.setPaths("test/path"); extraDirectories.setPermissions(ImmutableMap.of("file1", "123", "file2", "456")); }); Assert.assertEquals(1, testJibExtension.getExtraDirectories().getPaths().size()); Assert.assertEquals( Paths.get(fakeProject.getProjectDir().getPath(), "test", "path"), testJibExtension.getExtraDirectories().getPaths().get(0).getFrom()); Assert.assertEquals( ImmutableMap.of("file1", "123", "file2", "456"), testJibExtension.getExtraDirectories().getPermissions()); }