// Just test anything: it will fail if context wasn't found
assertEquals(0, proxy.getAge());
}
public void testEquals() {
IOther a = new AllInstancesAreEqual();
IOther b = new AllInstancesAreEqual();
NopInterceptor i1 = new NopInterceptor();
NopInterceptor i2 = new NopInterceptor();
ProxyFactory pfa = new ProxyFactory(a);
pfa.addAdvice(i1);
ProxyFactory pfb = new ProxyFactory(b);
pfb.addAdvice(i2);
IOther proxyA = (IOther) createProxy(pfa);
IOther proxyB = (IOther) createProxy(pfb);
assertEquals(pfa.getAdvisors().length, pfb.getAdvisors().length);
assertTrue(a.equals(b));
assertTrue(i1.equals(i2));
assertTrue(proxyA.equals(proxyB));
assertEquals(proxyA.hashCode(), proxyB.hashCode());
assertFalse(proxyA.equals(a));
// Equality checks were handled by the proxy
assertEquals(0, i1.getCount());