code: private Iteration<Statement, QueryEvaluationException> toStatementIteration(TupleQueryResult iter, final Resource subj, final URI pred, final Value obj) {
          return new ConvertingIteration<BindingSet, Statement, QueryEvaluationException>(iter) {
              @Override
              protected Statement convert(BindingSet b) throws QueryEvaluationException {
                  Resource s = subj==null ? (Resource)b.getValue("s") : subj;
                  URI p = pred==null ? (URI)b.getValue("p") : pred;
                  Value o = obj==null ? b.getValue("o") : obj;
                  URI ctx = (URI)b.getValue("ctx");
                  if (ctx.stringValue().equals(DEFAULT_GRAPH_URI)) {
                      ctx = null;
                  }
                  return getValueFactory().createStatement(s, p, o, ctx);
              }
          };
      }
docs: convert bindings
  
  @param iter
  @param subj
  @param pred
  @param obj
  @return iterator