@Test
  public void testToJibContainerBuilder_all()
      throws InvalidImageReferenceException, URISyntaxException, IOException,
          CacheDirectoryCreationException {
    BuildContext buildContext =
        JavaContainerBuilder.from("scratch")
            .setAppRoot("/hello")
            .addResources(getResource("core/application/resources"))
            .addClasses(getResource("core/application/classes"))
            .addDependencies(
                getResource("core/application/dependencies/dependency-1.0.0.jar"),
                getResource("core/application/dependencies/more/dependency-1.0.0.jar"))
            .addSnapshotDependencies(
                getResource("core/application/snapshot-dependencies/dependency-1.0.0-SNAPSHOT.jar"))
            .addProjectDependencies(
                getResource("core/application/dependencies/libraryA.jar"),
                getResource("core/application/dependencies/libraryB.jar"))
            .addToClasspath(getResource("core/fileA"), getResource("core/fileB"))
            .setClassesDestination(RelativeUnixPath.get("different-classes"))
            .setResourcesDestination(RelativeUnixPath.get("different-resources"))
            .setDependenciesDestination(RelativeUnixPath.get("different-libs"))
            .setOthersDestination(RelativeUnixPath.get("different-classpath"))
            .addJvmFlags("-xflag1", "-xflag2")
            .setMainClass("HelloWorld")
            .toContainerBuilder()
            .toBuildContext(Containerizer.to(RegistryImage.named("hello")));

    // Check entrypoint
    Assert.assertEquals(
        ImmutableList.of(
            "java",
            "-xflag1",
            "-xflag2",
            "-cp",
            "/hello/different-resources:/hello/different-classes:/hello/different-libs/*:/hello/different-classpath",
            "HelloWorld"),
        buildContext.getContainerConfiguration().getEntrypoint());

    // Check dependencies
    List<AbsoluteUnixPath> expectedDependencies =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-libs/dependency-1.0.0-770.jar"),
            AbsoluteUnixPath.get("/hello/different-libs/dependency-1.0.0-200.jar"));
    Assert.assertEquals(expectedDependencies, getExtractionPaths(buildContext, "dependencies"));

    // Check snapshots
    List<AbsoluteUnixPath> expectedSnapshotDependencies =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-libs/dependency-1.0.0-SNAPSHOT.jar"));
    Assert.assertEquals(
        expectedSnapshotDependencies, getExtractionPaths(buildContext, "snapshot dependencies"));

    List<AbsoluteUnixPath> expectedProjectDependencies =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-libs/libraryA.jar"),
            AbsoluteUnixPath.get("/hello/different-libs/libraryB.jar"));
    Assert.assertEquals(
        expectedProjectDependencies, getExtractionPaths(buildContext, "project dependencies"));

    // Check resources
    List<AbsoluteUnixPath> expectedResources =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-resources/resourceA"),
            AbsoluteUnixPath.get("/hello/different-resources/resourceB"),
            AbsoluteUnixPath.get("/hello/different-resources/world"));
    Assert.assertEquals(expectedResources, getExtractionPaths(buildContext, "resources"));

    // Check classes
    List<AbsoluteUnixPath> expectedClasses =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-classes/HelloWorld.class"),
            AbsoluteUnixPath.get("/hello/different-classes/some.class"));
    Assert.assertEquals(expectedClasses, getExtractionPaths(buildContext, "classes"));

    // Check additional classpath files
    List<AbsoluteUnixPath> expectedOthers =
        ImmutableList.of(
            AbsoluteUnixPath.get("/hello/different-classpath/fileA"),
            AbsoluteUnixPath.get("/hello/different-classpath/fileB"));
    Assert.assertEquals(expectedOthers, getExtractionPaths(buildContext, "extra files"));
  }
Gets the extraction paths in the specified layer of a give {@link BuildContext}.
jib-core/src/test/java/com/google/cloud/tools/jib/api/JavaContainerBuilderTest.java