list.add(first);
list.add(second);
String jsonResult = OJSONWriter.listToJSON(list, null);
ODocument doc = new ODocument();
doc.fromJSON("{\"result\": " + jsonResult + "}");
Collection<ODocument> result = doc.field("result");
Assert.assertTrue(result instanceof Collection);
Assert.assertEquals(result.size(), 2);
for (ODocument resultDoc : result) {
Assert.assertTrue(first.hasSameContentOf(resultDoc) || second.hasSameContentOf(resultDoc));