@Test
  public void testCreateContainerBuilder_correctSourceFiles()
      throws URISyntaxException, InvalidImageReferenceException, CacheDirectoryCreationException {
    ContainerBuilderLayers layers = new ContainerBuilderLayers(setupBuildContext());

    Path applicationDirectory = getResource("gradle/application");
    assertThat(layers.snapshotsLayer.getEntries())
        .comparingElementsUsing(SOURCE_FILE_OF)
        .containsExactly(
            applicationDirectory.resolve("dependencies/dependencyX-1.0.0-SNAPSHOT.jar"));
    assertThat(layers.dependenciesLayer.getEntries())
        .comparingElementsUsing(SOURCE_FILE_OF)
        .containsExactly(
            applicationDirectory.resolve("dependencies/dependency-1.0.0.jar"),
            applicationDirectory.resolve("dependencies/more/dependency-1.0.0.jar"),
            applicationDirectory.resolve("dependencies/another/one/dependency-1.0.0.jar"),
            applicationDirectory.resolve("dependencies/libraryA.jar"),
            applicationDirectory.resolve("dependencies/libraryB.jar"),
            applicationDirectory.resolve("dependencies/library.jarC.jar"));
    assertThat(layers.resourcesLayer.getEntries())
        .comparingElementsUsing(SOURCE_FILE_OF)
        .containsExactly(
            applicationDirectory.resolve("build/resources/main/resourceA"),
            applicationDirectory.resolve("build/resources/main/resourceB"),
            applicationDirectory.resolve("build/resources/main/world"));
    assertThat(layers.classesLayer.getEntries())
        .comparingElementsUsing(SOURCE_FILE_OF)
        .containsExactly(
            applicationDirectory.resolve("build/classes/java/main/HelloWorld.class"),
            applicationDirectory.resolve("build/classes/java/main/some.class"));

    List<FileEntry> allFileEntries = new ArrayList<>();
    allFileEntries.addAll(layers.snapshotsLayer.getEntries());
    allFileEntries.addAll(layers.dependenciesLayer.getEntries());
    allFileEntries.addAll(layers.classesLayer.getEntries());
    allFileEntries.addAll(layers.resourcesLayer.getEntries());
    Set<Instant> modificationTimes =
        allFileEntries.stream().map(FileEntry::getModificationTime).collect(Collectors.toSet());
    assertThat(modificationTimes).containsExactly(EPOCH_PLUS_32);
  }
Helper for reading back layers in a {@link BuildContext}.
jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleProjectPropertiesTest.java