code: public void put(String keyStr, SoyData value) {
  
      List<String> keys = split(keyStr, '.');
      int numKeys = keys.size();
  
      CollectionData collectionData = this;
      for (int i = 0; i <= numKeys - 2; ++i) {
  
        SoyData nextSoyData = collectionData.getSingle(keys.get(i));
        if (nextSoyData != null && !(nextSoyData instanceof CollectionData)) {
          throw new SoyDataException("Failed to evaluate key string \"" + keyStr + "\" for put().");
        }
        CollectionData nextCollectionData = (CollectionData) nextSoyData;
  
        if (nextCollectionData == null) {
          // Create the SoyData object that will be bound to keys.get(i). We need to check the first
          // part of keys[i+1] to know whether to create a SoyMapData or SoyListData (checking the
          // first char is sufficient).
          nextCollectionData =
              (Character.isDigit(keys.get(i + 1).charAt(0))) ? new SoyListData() : new SoyMapData();
          collectionData.putSingle(keys.get(i), nextCollectionData);
        }
        collectionData = nextCollectionData;
      }
  
      collectionData.putSingle(keys.get(numKeys - 1), ensureValidValue(value));
    }
docs: Puts data into this data tree at the specified key string.
  
  @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts).
  Indicates the path to the location within this data tree.
  @param value The data to put at the specified location.