code: public Class getRealClass(Object objectOrProxy)
      {
          IndirectionHandler handler;
  
          if(isNormalOjbProxy(objectOrProxy))
          {
              String msg;
  
              try
              {
                  handler = getIndirectionHandler(objectOrProxy);
                  /*
                   arminw:
                   think we should return the real class
                   */
                  // return handler.getIdentity().getObjectsTopLevelClass();
                  return handler.getIdentity().getObjectsRealClass();
              }
              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);
              }
          }
          else if(isVirtualOjbProxy(objectOrProxy))
          {
              handler = VirtualProxy.getIndirectionHandler((VirtualProxy) objectOrProxy);
              /*
               arminw:
               think we should return the real class
               */
              // return handler.getIdentity().getObjectsTopLevelClass();
              return handler.getIdentity().getObjectsRealClass();
          }
          else
          {
              return objectOrProxy.getClass();
          }
      }
docs: Get the real Class
  
  @param objectOrProxy
  @return Class