// Find all JavaObject heaproots that have our test thread as a source
// Remove their class names from our set of expected names.
Iterator rootIterator = getJavaRuntime().getHeapRoots().iterator();
while(rootIterator.hasNext()) {
JavaReference reference = (JavaReference) rootIterator.next();
if (thread.equals(reference.getSource())) {
if(reference.getTarget() instanceof JavaObject) {
JavaObject target = (JavaObject) reference.getTarget();
roots.remove(target.getJavaClass().getName());
}
}
}