code: public Object getRealObjectIfMaterialized(Object objectOrProxy)
      {
          if(isNormalOjbProxy(objectOrProxy))
          {
              String msg;
  
              try
              {
                  IndirectionHandler handler = getIndirectionHandler(objectOrProxy);
  
                  return handler.alreadyMaterialized() ? handler.getRealSubject() : null;
              }
              catch(ClassCastException e)
              {
                  // shouldn't happen but still ...
                  msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                  log.error(msg);
                  throw new PersistenceBrokerException(msg, e);
              }
              catch(IllegalArgumentException e)
              {
                  msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                  log.error(msg);
                  throw new PersistenceBrokerException(msg, e);
              }
              catch(PersistenceBrokerException e)
              {
                  log.error("Could not retrieve real object for given Proxy: " + objectOrProxy);
                  throw e;
              }
          }
          else if(isVirtualOjbProxy(objectOrProxy))
          {
              try
              {
                  VirtualProxy proxy = (VirtualProxy) objectOrProxy;
  
                  return proxy.alreadyMaterialized() ? proxy.getRealSubject() : null;
              }
              catch(PersistenceBrokerException e)
              {
                  log.error("Could not retrieve real object for VirtualProxy: " + objectOrProxy);
                  throw e;
              }
          }
          else
          {
              return objectOrProxy;
          }
      }
docs: Get the real Object for already materialized Handler
  
  @param objectOrProxy
  @return Object or null if the Handel is not materialized