@Test
  public void testNoImplicitParentDirectories() throws IOException {
    Set<String> directories = new HashSet<>();
    layerEntriesDo(
        (layerName, layerEntry) -> {
          String entryPath = layerEntry.getName();
          if (layerEntry.isDirectory()) {
            assertThat(entryPath.endsWith("/")).isTrue();
            entryPath = entryPath.substring(0, entryPath.length() - 1);
          }

          int lastSlashPosition = entryPath.lastIndexOf('/');
          String parent = entryPath.substring(0, Math.max(0, lastSlashPosition));
          if (!parent.isEmpty()) {
            assertThat(directories.contains(parent)).isTrue();
          }
          if (layerEntry.isDirectory()) {
            directories.add(entryPath);
          }
        });
  }
Verify that created image has explicit directory structures, default timestamps, permissions, and
file orderings.
jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/ReproducibleImageTest.java