@SuppressWarnings("unchecked") private void pruneMap(){
  Reference<? extends V> ref=queue.poll();
  while (ref != null) {
    map.remove(((Entry<K,V>)ref).key);
    ref=queue.poll();
  }
}

@ SuppressWarnings ( "unchecked" ) private void pruneMap ( ) { Reference < ? extends V > ref = queue . poll ( ) ; while ( ref != null ) { map . remove ( ( ( Entry < K , V > ) ref ) . key ) ; ref = queue . poll ( ) ; } }
discard the collected entries .
