code: func groupContainers(d *InstanceDiff) map[string]flatAttrDiff {
  	isIndex := multiVal.MatchString
  	containers := map[string]flatAttrDiff{}
  	attrs := d.CopyAttributes()
  	// we need to loop once to find the index key
  	for k := range attrs {
  		if isIndex(k) {
  			// add the key, always including the final dot to fully qualify it
  			containers[k[:len(k)-1]] = flatAttrDiff{}
  		}
  	}
  
  	// loop again to find all the sub keys
  	for prefix, values := range containers {
  		for k, attrDiff := range attrs {
  			// we include the index value as well, since it could be part of the diff
  			if strings.HasPrefix(k, prefix) {
  				values[k] = attrDiff
  			}
  		}
  	}
  
  	return containers
  }
docs: // sets, lists and maps need to be compared for diff inclusion as a whole, so
  // group the flatmapped keys together for easier comparison.