Consider importing the popular GcFinalization https://cs.corp.google.com/#google3/java/com/google/common/testing/GcFinalization.java&sq=package:google3%20-file:%5Eexperimental&q=gcfinalization&type=cs&l=61 as a testing utility for the jdk proper.
On Wed, Jan 30, 2013 at 5:09 AM, Alan Bateman <alan.bate...@oracle.com>wrote: > How robust is this test? I'm concerned that it might fail intermittently > if the System.gc doesn't immediately GC the now un-references entries in hm. >