{
Object inObject = createBigObject();
Object outObject;
MapCache mapCache;
SoftCache softCache;
mapCache = new MapCache(new Hashtable());
softCache = new SoftCache(mapCache);
softCache.addObject("key", inObject);
outObject = mapCache.getObject("key");
assertTrue("outObject instanceof Reference", outObject instanceof Reference);
assertTrue("cache2.getObject('key') == inObject", softCache.getObject("key") == inObject);
outObject = null;
inObject = null;
for (int i = 0; i < 10; i++)
{
Runtime.getRuntime().gc();
Runtime.getRuntime().runFinalization();
Runtime.getRuntime().gc();
softCache.addObject(new Integer(i), createBigObject());
//softCache.removeExpiredElements();
Thread.sleep(500);
}
}