code: public static Class getReferentClass(final Object entity) {
          if (isProxy(entity)) {
              return asProxy(entity).__getReferenceObjClass();
          } else {
              return entity != null ? entity.getClass() : null;
          }
      }
docs: Returns the class backing this entity
  
  @param entity the entity to check
  @return if proxied, the Class of the proxied type.  the entity's Class otherwise