code: public StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary)
  			throws IOException, MediaWikiApiErrorException {
  		if (isEmptyEdit()) {
  			return currentDocument;
  		} else if (toDelete.isEmpty() && getUpdatedStatements().size() == 1) {
  			// we can use "wbsetclaim" because we only have one statement to change
  			List<Statement> statements = getUpdatedStatements();
  			Statement statement = statements.get(0);
  			
  			if (statement.getStatementId() == null || statement.getStatementId().isEmpty()) {
  				statement = statement.withStatementId(guidGenerator.freshStatementId(currentDocument.getEntityId().getId()));
  
  			}
  			
  			JsonNode response = action.wbSetClaim(
  						JsonSerializer.getJsonString(statement), editAsBot,
  						currentDocument.getRevisionId(), summary);
  			
  			StatementImpl.PreStatement preStatement = getDatamodelObjectFromResponse(response, Collections.singletonList("claim"), StatementImpl.PreStatement.class);
  			Statement returnedStatement = preStatement.withSubject(statement.getClaim().getSubject());
  			long revisionId = getRevisionIdFromResponse(response);
  			
  			return currentDocument.withStatement(returnedStatement).withRevisionId(revisionId);
  		} else if (!toDelete.isEmpty() && getUpdatedStatements().size() == toDelete.size() && toDelete.size() <= 50) {
  			// we can use "wbremoveclaims" because we are only removing statements
  			
  			JsonNode response = action.wbRemoveClaims(toDelete, editAsBot, currentDocument.getRevisionId(), summary);
  			
  			long revisionId = getRevisionIdFromResponse(response);
  			
  			return currentDocument.withoutStatementIds(new HashSet<>(toDelete)).withRevisionId(revisionId);
  		} else {
  			return (StatementDocument) action.wbEditEntity(currentDocument
  				.getEntityId().getId(), null, null, null, getJsonUpdateString(),
  				false, editAsBot, currentDocument
  				.getRevisionId(), summary);
  		}
  	}
docs: Performs the update, selecting the appropriate API action depending on
  the nature of the change.
  
  @return the new document after update with the API
  @throws MediaWikiApiErrorException
  @throws IOException