private synchronized void removeEmptyClaimSets ( ) { Iterables . removeIf ( _map . values ( ) , new Predicate < Handle > ( ) { @ Override public boolean apply ( Handle handle ) { handle . getClaimSet ( ) . pump ( ) ; return handle . getRefCount ( ) . get ( ) == 0 && handle . getClaimSet ( ) . size ( ) == 0 ; } } ) ; }
Cleans up old claim sets for subscriptions that have become inactive . Ensures the map of claim sets doesn t grow forever .