Proxies can be tested whether they represent the same, remote object (isSameAs()). Proxies are functionally transparent with respect to equality, i.e. equals(Object) and hashCode() behaves the same whether applied to proxies and their underlying representation.
However, if the proxy connection breaks, both methods will become unusable (i.e. throw exceptions). Hence, proxy objects should not be stored in containers that continuously use those methods (e.g. java.util.HashMap).
The following optimisations are possible without affecting semantics: