build(order, repositories.getPersistentEntity(Order.class)).//
withLink(new Link("/orders/1")).//
build();
PagedResources<PersistentEntityResource> persistentEntityResource = new PagedResources<PersistentEntityResource>(
Arrays.asList(orderResource), new PageMetadata(1, 0, 10));
String result = mapper.writeValueAsString(persistentEntityResource);
assertThat(JsonPath.read(result, "$_embedded.orders[*].lineItems"), is(notNullValue()));
}