code: public void setId(String id) {
        if (StringUtils.isNullOrBlank(id)) {
           this.id = UUID.randomUUID().toString();
        } else {
           this.id = id;
        }
     }
docs: Sets the id of the document. If a null or blank id is given a random id will generated.
  
  @param id The new id of the document