docs: public PackingPlanBuilder addInstance(Integer containerId,
                                          String componentName) throws ConstraintViolationException {
      // create container if not existed
      initContainer(containerId);
  
      Integer taskId = taskIds.isEmpty() ? 1 : taskIds.last() + 1;
      Integer componentIndex = componentIndexes.containsKey(componentName)
          ? componentIndexes.get(componentName).last() + 1 : 0;
      InstanceId instanceId = new InstanceId(componentName, taskId, componentIndex);
  
      Resource instanceResource = componentResourceMap.getOrDefault(componentName,
          defaultInstanceResource);
  
      Container container = containers.get(containerId);
      PackingPlan.InstancePlan instancePlan
          = new PackingPlan.InstancePlan(instanceId, instanceResource);
  
      // Check constraints
      for (InstanceConstraint constraint : instanceConstraints) {
        constraint.validate(instancePlan);
      }
      for (PackingConstraint constraint : packingConstraints) {
        constraint.validate(container, instancePlan);
      }
      addToContainer(container, instancePlan, this.componentIndexes, this.taskIds);
  
      LOG.finest(String.format("Added to container %d instance %s", containerId, instanceId));
      return this;
    }