code: @SuppressWarnings("unchecked")
  	public <T extends StatementDocument> T updateStatements(T currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements,
  			String summary) throws MediaWikiApiErrorException, IOException {
  
  		StatementUpdate statementUpdate = new StatementUpdate(currentDocument,
  				addStatements, deleteStatements);
  		statementUpdate.setGuidGenerator(guidGenerator);
  		
  		if (statementUpdate.isEmptyEdit()) {
  			return currentDocument;
  		} else {
  			return (T) this.wbEditingAction.wbEditEntity(currentDocument
  				.getEntityId().getId(), null, null, null, statementUpdate
  				.getJsonUpdateString(), false, this.editAsBot, currentDocument
  				.getRevisionId(), summary);
  		}
  	}
docs: Updates statements of the given document. The document should be the
  current revision of the data that is to be updated. The updates are
  computed with respect to the data found in the document, making sure that
  no redundant deletions or duplicate insertions happen. The references of
  duplicate statements will be merged.
  <p>
  The generic type T of this method must be a general interface such as
  {@link ItemDocument}, {@link PropertyDocument}, or
  {@link StatementDocument}. Specific implementations of these interfaces
  are not permitted.
  
  @param currentDocument
  the document that is to be updated; needs to have a correct
  revision id and entity id
  @param addStatements
  the list of statements to be added or updated; statements with
  empty statement id will be added; statements with non-empty
  statement id will be updated (if such a statement exists)
  @param deleteStatements
  the list of statements to be deleted; statements will only be
  deleted if they are present in the current document (in
  exactly the same form, with the same id)
  @param summary
  short edit summary
  @return the updated document
  @throws MediaWikiApiErrorException
  if the API returns errors
  @throws IOException
  if there are IO problems, such as missing network connection