code: public String getDocumentId(Object instance) {
          if (instance == null) {
              return null;
          }
          DocumentInfo value = documentsByEntity.get(instance);
          return value != null ? value.getId() : null;
      }
docs: Gets the document id.
  
  @param instance instance to get document id from
  @return document id