docs: private Config lazyCreateConfig(Mode newMode) {
      if (newMode == this.mode) {
        return this;
      }
  
      // this is here so that we don't keep cascading deeper into object creation so:
      // localConfig == toLocalMode(toClusterMode(localConfig))
      Config newRawConfig = this.rawConfig;
      Config newLocalConfig = this.localConfig;
      Config newClusterConfig = this.clusterConfig;
      switch (this.mode) {
        case RAW:
          newRawConfig = this;
          break;
        case LOCAL:
          newLocalConfig = this;
          break;
        case CLUSTER:
          newClusterConfig = this;
          break;
        default:
          throw new IllegalArgumentException(
              "Unrecognized mode found in config: " + this.mode);
      }
  
      switch (newMode) {
        case LOCAL:
          if (this.localConfig == null) {
            Config tempConfig = Config.expand(Config.newBuilder().putAll(rawConfig.cfgMap).build());
            this.localConfig = new Config(Mode.LOCAL, newRawConfig, tempConfig, newClusterConfig);
          }
          return this.localConfig;
        case CLUSTER:
          if (this.clusterConfig == null) {
            Config.Builder bc = Config.newBuilder()
                .putAll(rawConfig.cfgMap)
                .put(Key.HERON_HOME, get(Key.HERON_CLUSTER_HOME))
                .put(Key.HERON_CONF, get(Key.HERON_CLUSTER_CONF));
            Config tempConfig = Config.expand(bc.build());
            this.clusterConfig = new Config(Mode.CLUSTER, newRawConfig, newLocalConfig, tempConfig);
          }
          return this.clusterConfig;
        case RAW:
        default:
          throw new IllegalArgumentException(
              "Unrecognized mode passed to lazyCreateConfig: " + newMode);
      }
    }