@Test
  public void testBuild_timestampNonDefault() throws IOException {
    Path file = createFile(temporaryFolder.getRoot().toPath(), "fileA", "some content", 54321);

    Blob blob =
        new ReproducibleLayerBuilder(
                ImmutableList.of(
                    new FileEntry(
                        file,
                        AbsoluteUnixPath.get("/fileA"),
                        FilePermissions.DEFAULT_FILE_PERMISSIONS,
                        Instant.ofEpochSecond(123))))
            .build();

    Path tarFile = temporaryFolder.newFile().toPath();
    try (OutputStream out = new BufferedOutputStream(Files.newOutputStream(tarFile))) {
      blob.writeTo(out);
    }

    // Reads the file back.
    try (TarArchiveInputStream in = new TarArchiveInputStream(Files.newInputStream(tarFile))) {
      assertThat(in.getNextEntry().getLastModifiedDate().toInstant())
          .isEqualTo(Instant.EPOCH.plusSeconds(123));
    }
  }
Verifies that the next {@link TarArchiveEntry} in the {@link TarArchiveInputStream} is a
directory with correct permissions.

@param tarArchiveInputStream the {@link TarArchiveInputStream} to read from
@param expectedExtractionPath the expected extraction path of the next entry
@throws IOException if an I/O exception occurs
jib-core/src/test/java/com/google/cloud/tools/jib/image/ReproducibleLayerBuilderTest.java