protected List<Statement> nextDocument() throws QueryEvaluationException {
    try {
      Map.Entry<Key, Value> entry = iter.peek();
      Key key = entry.getKey();
      Value value = entry.getValue();

      if (value.getSize() == 0) {
        // not an aggregate document
        return nextNonAggregateDocument();
        //                return
        // Collections.singletonList(RdfIO.readStatement(ByteStreams.newDataInput(key.getColumnQualifier().getBytes()), VALUE_FACTORY, true));
      }

      List<Statement> document = new ArrayList<Statement>();

      org.openrdf.model.Value subj =
          RdfIO.readValue(
              ByteStreams.newDataInput(key.getColumnQualifier().getBytes()),
              VALUE_FACTORY,
              FAMILY_DELIM);
      Map<String, String> map = converter.toMap(entry.getKey(), value);
      for (Map.Entry<String, String> e : map.entrySet()) {
        String predObj = e.getKey();
        String[] split = predObj.split(FAMILY_DELIM_STR);
        document.add(
            new StatementImpl(
                (Resource) subj,
                VALUE_FACTORY.createURI(split[0]),
                RdfIO.readValue(
                    ByteStreams.newDataInput(split[1].getBytes()), VALUE_FACTORY, FAMILY_DELIM)));
      }
      iter.next();
      return document;
    } catch (Exception e) {
      throw new QueryEvaluationException("Error retrieving document", e);
    }
  }