return proxyInstance.toString();
return "Proxy stub:"+ref.remoteToString();
  public Object invoke(Object proxyInstance, Method method, Object[] parameters)      throws Throwable  {    if (!(proxyInstance instanceof Remote))      {        String name = proxyInstance == null ? "null"                                           : proxyInstance.getClass().getName();        throw new IllegalAccessException(name + " does not implement "                                         + Remote.class.getName());      }    String name = method.getName();    switch (name.charAt(0))      {      case 'e':        if (parameters.length == 1 && name.equals("equals")            && method.getParameterTypes()[0].equals(Object.class))          {            if (parameters[0] instanceof Proxy)              {                Object handler = Proxy.getInvocationHandler(parameters[0]);                if (handler == null)                  return Boolean.FALSE;                else                  return handler.equals(this) ? Boolean.TRUE : Boolean.FALSE;              }            else              return Boolean.FALSE;          }        break;      case 'h':        if (parameters.length == 0 && name.equals("hashCode"))          {            int hashC = Proxy.getInvocationHandler(proxyInstance).hashCode();            return new Integer(hashC);          }        break;      case 't':        if (parameters.length == 0 && name.equals("toString"))          return proxyInstance.toString();        break;      default:        break;      }    Long hash = (Long) methodHashCodes.get(method);    if (hash == null)      {        hash = new Long(RMIHashes.getMethodHash(method));        methodHashCodes.put(method, hash);      }    try      {        return getRef().invoke((Remote) proxyInstance, method, parameters,                               hash.longValue());      }    catch (RuntimeException exception)      {        // RuntimeException is always supported.        throw exception;      }    catch (RemoteException exception)      {        // All remote methods can throw RemoteException.        throw exception;      }    catch (Error exception)      {        throw exception;      }    catch (Exception exception)      {        Class[] exceptions = method.getExceptionTypes();        Class exceptionClass = exception.getClass();        for (int i = 0; i < exceptions.length; i++)          {            if (exceptions[i].equals(exceptionClass))              throw exception;          }        throw new UnexpectedException(method.getName(), exception);      }  }