public Factory newChildProducer() {
    decrementRemainingAllocationUnits(1);

    return new Factory() {

      private boolean used = false;

      @Override
      public ProgressEventDispatcher create(String description, long allocationUnits) {
        Preconditions.checkState(!used);
        used = true;
        return newProgressEventDispatcher(
            eventHandlers, allocation.newChild(description, allocationUnits));
      }
    };
  }
Creates a new {@link Factory} for a {@link ProgressEventDispatcher} that manages a child {@link
Allocation}. Since each child {@link Allocation} accounts for 1 allocation unit of its parent,
this method decrements the {@link #remainingAllocationUnits} by {@code 1}.

@return a new {@link Factory}
jib-core/src/main/java/com/google/cloud/tools/jib/builder/ProgressEventDispatcher.java