code: public Set<Term> getAllTerms() {
          final Set<Term> ret = new HashSet<Term>();
          for (final StatementGroup sg : statementGroups) {
              for (final Statement stmt : sg.getAllStatements()) {
                  ret.addAll(stmt.getAllTerms());
              }
          }
          return ret;
      }
docs: Returns the set of all terms contained within the document.
  
  @return Set of terms, which may be empty