}
@SuppressWarnings("unchecked")
@Test
public void testEquals() throws Exception {
ProxyManager mgr = context().getService(ProxyManager.class);
Bundle b = FrameworkUtil.getBundle(this.getClass());
TestCallable c = new TestCallable();
c.setReturn(new TestDelegate("One"));
TestCallable c2 = new TestCallable();
c.setReturn(new TestDelegate("Two"));
Collection<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(List.class);
Object proxy = mgr.createDelegatingProxy(b, classes, c, new TestDelegate("Three"));
Object otherProxy = mgr.createDelegatingProxy(b, classes, c, new TestDelegate("Four"));
Object totallyOtherProxy = mgr.createDelegatingProxy(b, classes, c2, new TestDelegate("Five"));
assertTrue("The object is not equal to itself", proxy.equals(proxy));
assertTrue("The object is not equal to another proxy of itself", proxy.equals(otherProxy));
assertFalse("The object is equal to proxy to another object", proxy.equals(totallyOtherProxy));
}