code: @VisibleForTesting
    Config updateNumContainersIfNeeded(Config initialConfig,
                                       TopologyAPI.Topology initialTopology,
                                       PackingPlan packingPlan) {
  
      int configNumStreamManagers = TopologyUtils.getNumContainers(initialTopology);
      int packingNumStreamManagers = packingPlan.getContainers().size();
  
      if (configNumStreamManagers == packingNumStreamManagers) {
        return initialConfig;
      }
  
      Config.Builder newConfigBuilder = Config.newBuilder()
          .putAll(initialConfig)
          .put(Key.NUM_CONTAINERS, packingNumStreamManagers + 1)
          .put(Key.TOPOLOGY_DEFINITION,
              cloneWithNewNumContainers(initialTopology, packingNumStreamManagers));
  
      String packingClass = Context.packingClass(config);
      LOG.warning(String.format("The packing plan (generated by %s) calls for a different number of "
              + "containers (%d) than what was explicitly set in the topology configs (%d). "
              + "Overriding the configs to specify %d containers. When using %s do not explicitly "
              + "call config.setNumStmgrs(..) or config.setNumWorkers(..).",
          packingClass, packingNumStreamManagers, configNumStreamManagers,
          packingNumStreamManagers, packingClass));
  
      return newConfigBuilder.build();
    }
docs: Checks that the number of containers specified in the topology matches the number of containers
  called for in the packing plan. If they are different, returns a new config with settings
  updated to align with the packing plan. The new config will include an updated
  Key.TOPOLOGY_DEFINITION containing a cloned Topology with it's settings also updated.
  
  @param initialConfig initial config to clone and update (if necessary)
  @param initialTopology topology to check and clone/update (if necessary)
  @param packingPlan packing plan to compare settings with
  @return a new Config cloned from initialConfig and modified as needed to align with packedPlan