code: public void mergeWithDefaults(GlobalMetadata defaults) {
      List<String> defaultTransferEncoding = defaults.getTransferEncoding();
      List<String> myEncoding = getTransferEncoding();
  
      if (defaultTransferEncoding != null) {
        if (myEncoding == null) {
          setDatasetMetadata(TRANSFER_ENCODING_KEY, defaultTransferEncoding);
        } else {
          List<String> combinedEncoding = new ArrayList<>();
          combinedEncoding.addAll(myEncoding);
          combinedEncoding.addAll(defaultTransferEncoding);
  
          setDatasetMetadata(TRANSFER_ENCODING_KEY, combinedEncoding);
        }
      }
  
      for (Map.Entry<String, Object> entry : defaults.datasetLevel.entrySet()) {
        if (!datasetLevel.containsKey(entry.getKey())) {
          setDatasetMetadata(entry.getKey(), entry.getValue());
        }
      }
    }
docs: Merge default settings into this object. Logic is very similar to addAll(), but Transfer-Encoding gets
  special treatment; the 'default' transfer-encoding settings are appended to any transfer-encoding
  already set (vs simply overwriting them).