/** The next available object. */
Object next = null;
public boolean hasNext() {
while (iter.hasNext()) {
WeakObject weak = (WeakObject)iter.next();
Object obj = null;
if (weak != null && (obj = weak.get()) == null) {
// object has been reclaimed by the GC
continue;
}
next = obj;