Will set the id property on the document IF a mutator exists. Otherwise
nothing happens.

@param document
@param id
329231
public static void setId(Object document, String id) {
		DocumentAccessor d = getAccessor(document);
		if (d.hasIdMutator()) {
			d.setId(document, id);
		}
	}
1027613
public void setAttribute(String id, Object obj, boolean save) {
        if (save) {
            String historyAttribute = id + "history";
            Queue<Object> history = (Queue<Object>) getAttribute(historyAttribute);
            if (history == null) {
                history = new LinkedList<>();
                setAttribute(historyAttribute, history);
            }
            if (this.getAttribute(id) != null) {
                history.add(getAttribute(id));
            }
        }
        setAttribute(id, obj);
    }
1352159
public Document<K> addDocument(K id, String document)
    {
        return addDocument(id, preprocess(document));
    }
742551
static void checkId(String id) {
    if (!ID.matcher(id).matches()) {
      throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id));
    }
  }
498768
public void setUUID(String id) {
		try {
			this.value = (id != null) ? UUID.fromString(id) : null;
		} catch (Throwable exception) {
			assert id != null;
			this.value = UUID.nameUUIDFromBytes(id.getBytes());
		}
		this.type = AttributeType.UUID;
		this.assigned = this.value != null;
	}
846184
public void document_id_DELETE(String id) throws IOException {
		String qPath = "/me/document/{id}";
		StringBuilder sb = path(qPath, id);
		exec(qPath, "DELETE", sb.toString(), null);
	}
698917
public function setId( $id )
	{
		if( $id === $this->getId() ) { return; }

		$this->_values['id'] = (string) $id ;
		$this->setModified();
	}
865136
public void setId(Object id) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  /*if (idFlag == SET) {
		 if (tc.isDebugEnabled()) Tr.debug(tc, "Illegal State: tried to set id to "+id+
											   ", but id was already set to "+this.id  );
		  throw new IllegalStateException("id was already set");
	  } */
	  idFlag = SET;
	  this.id = id;
	  if (tc.isDebugEnabled())
		 Tr.debug(tc, "set id=" + id);
   }
1227896
public static void setIdFieldValue(ODocument document, String value) {
        setFieldValue(document, OGraphDatabase.LABEL, value);
    }
663981
@NonNull
    public ListenerToken addDocumentChangeListener(
        @NonNull String id,
        Executor executor,
        @NonNull DocumentChangeListener listener) {
        if (id == null) { throw new IllegalArgumentException("id cannot be null."); }
        if (listener == null) { throw new IllegalArgumentException("listener cannot be null."); }

        synchronized (lock) {
            mustBeOpen();
            return addDocumentChangeListener(executor, listener, id);
        }
    }
878953
@Override
	public Mono<Void> deleteById(String id) {

		return findSession(id)
				.flatMap(document -> this.mongoOperations.remove(document, this.collectionName).then(Mono.just(document)))
				.map(document -> convertToSession(this.mongoSessionConverter, document))
				.doOnSuccess(mongoSession -> publishEvent(new SessionDeletedEvent(this, mongoSession))) //
				.then();
	}
370796
public void addDocument(Document doc) throws HelloSignException {
        if (doc == null) {
            throw new HelloSignException("Document cannot be null");
        }
        documents.add(doc);
    }
114707
public void setId(int v) {
    if (Coref_Type.featOkTst && ((Coref_Type)jcasType).casFeat_id == null)
      jcasType.jcas.throwFeatMissing("id", "de.julielab.jules.types.muc7.Coref");
    jcasType.ll_cas.ll_setIntValue(addr, ((Coref_Type)jcasType).casFeatCode_id, v);}
235664
private void setIdValue(Object target, JsonNode idValue) throws IllegalAccessException {
		Field idField = configuration.getIdField(target.getClass());
		ResourceIdHandler idHandler = configuration.getIdHandler(target.getClass());

		if (idValue != null) {
			idField.set(target, idHandler.fromString(idValue.asText()));
		}
	}
546420
protected void setOwnerId(Integer id){
        if(getOwnerId() != null){
            logger.warn("Attempting to set owner id for an object where it as previously been set. Ignoring new id");
            return;
        }
        meta_put(OWNER_ID_KEY, id); // dont allow null
    }
368531
@NonNull
    @Override
    public MutableDocument setInt(@NonNull String key, int value) {
        return setValue(key, value);
    }
396468
public static void setId(Object object, Object id) {
		try {
			Field idField = getIdField(object.getClass());
			if (idField != null) {
				idField.set(object, id);
			}
		} catch (IllegalAccessException | IllegalArgumentException e) {
			throw new LoggingRuntimeException(e, logger, "setting Id failed");
		}
	}