code: private Object extractObjectToStore(Object obj)
      {
          Object result = obj;
          // only do something if obj != null
          if(result != null)
          {
              // ProxyObjects only have to be updated if their real
              // subjects have been loaded
              result = getProxyFactory().getRealObjectIfMaterialized(obj);
              // null for unmaterialized Proxy
              if (result == null)
              {
                  if(logger.isDebugEnabled())
                      logger.debug("No materialized object could be found -> nothing to store," +
                              " object was " + ObjectUtils.identityToString(obj));
              }
          }
          return result;
      }
docs: Check if the given object is <code>null</code> or an unmaterialized proxy object - in
  both cases <code>null</code> will be returned, else the given object itself or the
  materialized proxy object will be returned.