code: public RepositoryResult<Statement> getStatements(Resource subj, URI pred, Value obj, boolean includeInferred) throws RepositoryException {
          try {
              if (isQuadMode()) {
                  TupleQuery tupleQuery = prepareTupleQuery(GET_STATEMENTS);
                  setBindings(tupleQuery, subj, pred, obj);
                  tupleQuery.setIncludeInferred(includeInferred);
                  TupleQueryResult qRes = tupleQuery.evaluate();
                  return new RepositoryResult<Statement>(
                          new ExceptionConvertingIteration<Statement, RepositoryException>(
                                  toStatementIteration(qRes, subj, pred, obj)) {
                              @Override
                              protected RepositoryException convert(Exception e) {
                                  return new RepositoryException(e);
                              }
                          });
              } else if (subj != null && pred != null && obj != null) {
                  if (hasStatement(subj, pred, obj, includeInferred)) {
                      Statement st = new StatementImpl(subj, pred, obj);
                      CloseableIteration<Statement, RepositoryException> cursor;
                      cursor = new SingletonIteration<Statement, RepositoryException>(st);
                      return new RepositoryResult<Statement>(cursor);
                  } else {
                      return new RepositoryResult<Statement>(new EmptyIteration<Statement, RepositoryException>());
                  }
              }
              GraphQuery query = prepareGraphQuery(EVERYTHING);
              setBindings(query, subj, pred, obj);
              GraphQueryResult result = query.evaluate();
              return new RepositoryResult<Statement>(
                      new ExceptionConvertingIteration<Statement, RepositoryException>(result) {
                          @Override
                          protected RepositoryException convert(Exception e) {
                              return new RepositoryException(e);
                          }
                      });
          } catch (MalformedQueryException e) {
              throw new RepositoryException(e);
          } catch (QueryEvaluationException e) {
              throw new RepositoryException(e);
          }
      }
docs: returns all statements
  
  @param subj
  @param pred
  @param obj
  @param includeInferred
  @throws RepositoryException