boolean () { KeyReference<K> wk; boolean processed = false; //noinspection unchecked while ((wk = (KeyReference<K>)myReferenceQueue.poll()) != null) { myMap.remove(wk); processed = true; } return processed; }