static ImmutableList<BuildAndCacheApplicationLayerStep> makeList(
      BuildContext buildContext, ProgressEventDispatcher.Factory progressEventDispatcherFactory) {
    List<FileEntriesLayer> layerConfigurations = buildContext.getLayerConfigurations();

    try (ProgressEventDispatcher progressEventDispatcher =
            progressEventDispatcherFactory.create(
                "launching application layer builders", layerConfigurations.size());
        TimerEventDispatcher ignored =
            new TimerEventDispatcher(
                buildContext.getEventHandlers(), "Preparing application layer builders")) {
      return layerConfigurations.stream()
          // Skips the layer if empty.
          .filter(layerConfiguration -> !layerConfiguration.getEntries().isEmpty())
          .map(
              layerConfiguration ->
                  new BuildAndCacheApplicationLayerStep(
                      buildContext,
                      progressEventDispatcher.newChildProducer(),
                      layerConfiguration.getName(),
                      layerConfiguration))
          .collect(ImmutableList.toImmutableList());
    }
  }
Makes a list of {@link BuildAndCacheApplicationLayerStep} for dependencies, resources, and
classes layers. Optionally adds an extra layer if configured to do so.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/BuildAndCacheApplicationLayerStep.java