code: protected static Object setIdForEntity(Object document, Method setterMethodForId) {
      Object id = UUID.randomUUID().toString();
      if (null != setterMethodForId) {
        try {
          id = setterMethodForId.invoke(document, id);
        } catch (IllegalAccessException e) {
          logger.error("Failed to invoke setter method for a idAnnotated field due to permissions", e);
          throw new InvalidJsonDbApiUsageException("Failed to invoke setter method for a idAnnotated field due to permissions", e);
        } catch (IllegalArgumentException e) {
          logger.error("Failed to invoke setter method for a idAnnotated field due to wrong arguments", e);
          throw new InvalidJsonDbApiUsageException("Failed to invoke setter method for a idAnnotated field due to wrong arguments", e);
        } catch (InvocationTargetException e) {
          logger.error("Failed to invoke setter method for a idAnnotated field, the method threw a exception", e);
          throw new InvalidJsonDbApiUsageException("Failed to invoke setter method for a idAnnotated field, the method threw a exception", e);
        }
      }
      return id;
    }
docs: A utility method to set the value of field marked by the @Id annotation using its
  setter/mutator method.
  TODO: Some day we want to support policies for generation of ID like AutoIncrement etc.
  
  @param document the actual Object representing the POJO we want the Id to be set for.
  @param setterMethodForId the Method that is the mutator for the attributed with @Id annotation
  @return the Id that was generated and set