assertEquals("application/json",
r.getMetadata().getFirst("Content-Type").toString());
ByteArrayOutputStream os = new ByteArrayOutputStream();
new JSONProvider().writeTo(
(Document)r.getEntity(), Document.class, Document.class,
new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE,
new MetadataMap<String, Object>(), os);
String s = os.toString();
String expected1 =