code: public byte [] writeDocumentCollection(JSONAPIDocument<? extends Iterable<?>> documentCollection,
  										   SerializationSettings serializationSettings)
  			throws DocumentSerializationException {
  
  		try {
  			resourceCache.init();
  			ArrayNode results = objectMapper.createArrayNode();
  			Map<String, ObjectNode> includedDataMap = new LinkedHashMap<>();
  
  			for (Object object : documentCollection.get()) {
  				results.add(getDataNode(object, includedDataMap, serializationSettings));
  			}
  
  			ObjectNode result = objectMapper.createObjectNode();
  			result.set(DATA, results);
  
  			// Handle global links and meta
  			serializeMeta(documentCollection, result, serializationSettings);
  			serializeLinks(documentCollection, result, serializationSettings);
  
  			result = addIncludedSection(result, includedDataMap);
  
  			return objectMapper.writeValueAsBytes(result);
  		} catch (Exception e) {
  			throw new DocumentSerializationException(e);
  		} finally {
  			resourceCache.clear();
  		}
  	}
docs: Serializes provided {@link JSONAPIDocument} into JSON API Spec compatible byte representation.
  @param documentCollection {@link JSONAPIDocument} document collection to serialize
  @param serializationSettings {@link SerializationSettings} settings that override global serialization settings
  @return serialized content in bytes
  @throws DocumentSerializationException thrown in case serialization fails