!7 p { setOpt(javax(), 'weakMaps_debug, true); L maps = allWeakMaps(); print(l(maps) + ": " + map getClassName(maps)); Map map = newWeakIdentityHashMap(); print(allWeakMaps()); Map map2 = newWeakHashMap(); maps = allWeakMaps(); print(l(maps) + ": " + map getClassName(maps)); assertTrue("1", containsExactObject(maps, map)); assertTrue("2", containsExactObject(maps, map2)); print("Testing GC"); map = null; map2 = null; int n = l(maps); while (l(maps) > n-2) { maps = null; gc(); //sleepSeconds(1); maps = allWeakMaps(); print(l(maps) + ": " + map getClassName(maps)); } print("OK!"); }