private <T>int countClearedRefs(List<WeakReference<T>> refs){
  final Iterator<WeakReference<T>> itr=refs.iterator();
  int n=0;
  while (itr.hasNext()) {
    final WeakReference<T> ref=itr.next();
    if (ref.get() == null)     n++;
  }
  return n;
}

private < T > int countClearedRefs ( List < WeakReference < T > > refs ) { final Iterator < WeakReference < T > > itr = refs . iterator ( ) ; int n = 0 ; while ( itr . hasNext ( ) ) { final WeakReference < T > ref = itr . next ( ) ; if ( ref . get ( ) == null ) n ++ ; } return n ; }
return the # of entries in the collection whose references have been cleared .
