Repository: GoogleContainerTools/jib
File: jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java (Java)

Code before:
        .isEqualTo("/non/default/target");
  }

  @Test
  public void testExtraDirectories_fileForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> extraDirectories.setPaths(Paths.get("test/path").toFile()));
    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(1);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
  }

  @Test
  public void testExtraDirectories_stringListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> extraDirectories.setPaths(Arrays.asList("test/path", "another/path")));

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(1).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("another/path"));
  }

  @Test
  public void testExtraDirectories_lazyStringListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> {
          ProviderFactory providerFactory = fakeProject.getProviders();
          Provider<Object> paths =
              providerFactory.provider(() -> Arrays.asList("test/path", "another/path"));
          extraDirectories.setPaths(paths);
        });

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(1).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("another/path"));
  }

  @Test
  public void testExtraDirectories_fileListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories ->
            extraDirectories.setPaths(
                Arrays.asList(
                    Paths.get("test", "path").toFile(), Paths.get("another", "path").toFile())));

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())

Review comment (suggestion):
How about we name this:

```suggestion
  public void testExtraDirectories_lazyEvaluation_StringListForPaths() {
```

Code after:
        .isEqualTo("/non/default/target");
  }

  @Test
  public void testExtraDirectories_fileForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> extraDirectories.setPaths(Paths.get("test/path").toFile()));
    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(1);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
  }

  @Test
  public void testExtraDirectories_stringListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> extraDirectories.setPaths(Arrays.asList("test/path", "another/path")));

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(1).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("another/path"));
  }

  @Test
  public void testExtraDirectories_lazyEvaluation_StringListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories -> {
          ProviderFactory providerFactory = fakeProject.getProviders();
          Provider<Object> paths =
              providerFactory.provider(() -> Arrays.asList("test/path", "another/path"));
          extraDirectories.setPaths(paths);
        });

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("test/path"));
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(1).getFrom())
        .isEqualTo(fakeProject.getProjectDir().toPath().resolve("another/path"));
  }

  @Test
  public void testExtraDirectories_fileListForPaths() {
    testJibExtension.extraDirectories(
        extraDirectories ->
            extraDirectories.setPaths(
                Arrays.asList(
                    Paths.get("test", "path").toFile(), Paths.get("another", "path").toFile())));

    assertThat(testJibExtension.getExtraDirectories().getPaths()).hasSize(2);
    assertThat(testJibExtension.getExtraDirectories().getPaths().get(0).getFrom())