code: public static String objectId(Object object) {
          if (object == null) {
              return "?";
          }
          if (object instanceof IdInfoProvider) {
              return getId(((IdInfoProvider) object).idScope(),
                  ((IdInfoProvider) object).idObject());
          } else {
              return getId(object.getClass(), object);
          }
      }
docs: Returns an id of the object that is unique within a specific scope. Ids
  are generated and looked up in the scope of the object's class unless the
  class implements {@link IdInfoProvider}.
  
  @param object
  the object
  @return the object's name