assertNotNull("resp.metadata shouldn't be null", resp.getMetadata());
Object contentType = resp.getMetadata().getFirst(HttpHeaderNames.CONTENT_TYPE);
assertNotNull("resp.entity shouldn't be null", contentType);
assertEquals("contentType should be application/xml but is" + contentType, contentType, MediaType.APPLICATION_XML);
assertTrue("entity should be of type ListTasksDTO", entity instanceof ListTasksDTO);
ListTasksDTO dto = (ListTasksDTO) entity;
List<TaskRefDTO> dtoTasks = dto.getTask();
assertNotNull("dtoTasks shouldn't be null", dtoTasks);
assertEquals("dtoTasks should have " + tasks.size() + " elements but it has " + dtoTasks.size(), tasks.size(), dtoTasks.size());
}