protected function collectPresetValue(
    &$collected_data,
    $multiple_presets,
    $target_property_name,
    $target_property_info,
    $preset_property_data
  ) {
    // Check the format of the value is compatible with multiple presets.
    if ($multiple_presets) {
      if (!in_array($target_property_info['format'], ['array', 'compound'])) {
        // TODO: check cardinality is allowable as well!
        // TODO: give the preset name! ARGH another parameter :(
        throw new \Exception("Multiple presets not compatible with single-valued properties, with target property {$target_property_name}.");
      }
    }

    if (isset($collected_data[$target_property_name])) {
      // Merge the data. The check above should have covered that this is
      // allowed.
      $collected_data[$target_property_name] = array_merge($collected_data[$target_property_name], $preset_property_data);
    }
    else {
      $collected_data[$target_property_name] = $preset_property_data;
    }
  }