@Test
public void testAddRelationshipCollection() {

	//Record
	setUpExpectations();
	JsonApiIdentifiable minimalEntity = createMinimalEntity();
	Collection<JsonApiIdentifiable> relatedCollection = new LinkedList<>();
	for (int i = 0; i < NR_ENTITIES; i++) {
		relatedCollection.add(createCustomMinimalEntity(String.valueOf(i)));
	}
	//Replay
	Response result = JsonApiResponse
		.createGetResponse(uriInfo)
		.data(minimalEntity)
		.addRelationship("related", relatedCollection, uriInfo.getAbsolutePath())
		.build();
	//Verify
	assertIsValidJsonApiDataResponse(result);
	JsonNode resultJson = extractJsonEntity(result).get("data");
	Assert.assertEquals(1, resultJson.get("relationships").size());
	Assert.assertTrue(resultJson.get("relationships").has("related"));
	JsonNode relationshipNode = resultJson.get("relationships").get("related");
	assertHasValidRelationshipData(relationshipNode);
	for (int i = 0; i < NR_ENTITIES; i++) {
		Assert.assertEquals(String.valueOf(i), relationshipNode.get("data").get(i).get("id").textValue());
	}
}