code: public int addStatement(TableStatement tblStatement, Statement statement,
              int did) {
          if (tblStatement == null) {
              throw new InvalidArgument("statement is null");
          }
  
          // duplicate statement check
          Integer existingIndex = visitedStatements.get(statement);
          if (existingIndex != null) {
              return existingIndex;
          }
  
          int nsid = statements.size();
          statements.add(tblStatement);
  
          visitedStatements.put(statement, nsid);
          indexedStatements.put(nsid, statement);
  
          globalStatementIndex.put(nsid, nsid);
          statementDocumentMap.put(nsid, did);
          tableStatementIndex.put(tblStatement, nsid);
  
          return nsid;
      }
docs: Adds a statement to the {@code statements} set. The insertion index and
  statement occurrences are also indexed in the {@code index} and
  {@code count} map. <br/>
  <br/>
  Uses statement ids as 1-based to support nested statements as an
  <tt>int</tt>.
  
  @param tblStatement {@link TableStatement}, the statement to be added to
  the {@code statements} set
  @param did Document index
  @return int, the index of the added statement, which is 'int' datatype
  since it cannot be null
  @throws InvalidArgument Thrown if {@code statement} is null