assertTrue("the obtained result is empty", obtained.hasNext());
Iterator<ValuePathTuple> exp = expected.iterator();
while (exp.hasNext() && obtained.hasNext()) {
ValuePathTuple vpt = exp.next();
Row row = obtained.nextRow();
// check manually about paths and dates
// if paths don't match maybe the date does. It's the date we care, in case of multiple
// paths under the same date the order of them is non-deterministic dependent on
// persistence rules
if (!vpt.getPath().equals(row.getPath())) {
String property = row.getNode().getProperty(ORDERED_PROPERTY).getString();
if (!vpt.getValue().equals(property)) {
fail(String.format(
"both path and date failed to match. Expected: %s - %s. Obtained: %s, %s",
vpt.getPath(),
vpt.getValue(),
row.getPath(),
property
));
}
}