int expectedFinalRetainCount = expectedAutorelease ?
expectedInitialRetainCount - 1 : expectedInitialRetainCount;
NSAutoreleasePool pool = NSAutoreleasePool.new_();
NSObject object = factory.create();
assertRetainCount(expectedInitialRetainCount, object);
// aliasing should increase the retain count, as the alias also owns it
NSObject alias = Rococoa.cast(object, NSObject.class);
assertSame(object.id(), alias.id());
assertRetainCount(expectedInitialRetainCount + 1, object);
assertRetainCount(expectedInitialRetainCount + 1, alias);
// wait until object has been GC'd
WeakReference<Object> reference = new WeakReference<Object>(object);