public final boolean removeIf ( BiPredicate < ? super K , ? super V > filter ) { Objects . requireNonNull ( filter ) ; if ( isEmpty ( ) ) return false ; Segment < K , V > segment ; int mc = this . modCount ; int initialModCount = mc ; for ( long segmentIndex = 0 ; segmentIndex >= 0 ; segmentIndex = nextSegmentIndex ( segmentIndex , segment ) ) { mc = ( segment = segment ( segmentIndex ) ) . removeIf ( this , filter , mc ) ; } if ( mc != modCount ) throw new ConcurrentModificationException ( ) ; return mc != initialModCount ; }
Removes all of the entries of this map that satisfy the given predicate . Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller .