Removes all the items from the cache whose key matches the specified predicate.

@param predicate returns true if an item with the given key should be removed
@return number of the items removed from the cache
541367
public int removeAll(Predicate<K> predicate) {
    ArrayList<Entry<K, V>> oldExclusives;
    ArrayList<Entry<K, V>> oldEntries;
    synchronized (this) {
      oldExclusives = mExclusiveEntries.removeAll(predicate);
      oldEntries = mCachedEntries.removeAll(predicate);
      makeOrphans(oldEntries);
    }
    maybeClose(oldEntries);
    maybeNotifyExclusiveEntryRemoval(oldExclusives);
    maybeUpdateCacheParams();
    maybeEvictEntries();
    return oldEntries.size();
  }
244933
public static <T> List<T> filter( Iterable<T> collection, Predicate<T> predicate)
    {
        List<T> filtered = new ArrayList<T>();
        for (T element : collection)
        {
        	if (predicate.isVerifiedBy(element))
        	{
        		filtered.add(element);
        	}
        }
        return filtered;
    }
1198732
public static <V> Predicate<TaskContext<V>> ifResult(Predicate<V> predicate) {
        return ctx -> predicate.test(ctx.getResult());
    }
1001967
public boolean is(VectorPredicate predicate) {
        boolean result = true;
        VectorIterator it = iterator();

        while (it.hasNext()) {
            double x = it.next();
            int i = it.index();
            result = result && predicate.test(i, x);
        }

        return result;
    }
25377
public static <K, V, E extends Exception> boolean removeIf(final Map<K, V> map, final Try.Predicate<? super Map.Entry<K, V>, E> filter) throws E {
        List<K> keysToRemove = null;

        for (Map.Entry<K, V> entry : map.entrySet()) {
            if (filter.test(entry)) {
                if (keysToRemove == null) {
                    keysToRemove = new ArrayList<>(7);
                }

                keysToRemove.add(entry.getKey());
            }
        }

        if (N.notNullOrEmpty(keysToRemove)) {
            for (K key : keysToRemove) {
                map.remove(key);
            }

            return true;
        }

        return false;
    }
1337641
public boolean walkUntil(Predicate<StringWalker> predicate)
	{
		if (predicate.test(this))
			return true;
		while (nextCharacter())
			if (predicate.test(this))
				return true;
		return false;
	}
618170
public boolean every(Func1<? super T, Boolean> predicate) {
        for (T item : this) {
            if (!predicate.call(item))
                return false;
        }
        return true;
    }
1372189
public boolean remove(Object o) {
        boolean removed = false;
        for (Set<T> s : sets)
            if (s.remove(o))
                removed = true;
        return removed;
    }
29926
public static <K, V> List<V> removeAllIfByEntry(Map<K, V> map,
            Predicate<? super Entry<K, V>> filter) {
        return getEntryStreamWithFilter(map, filter).map(Entry::getKey)
                .collect(toList()).stream().map(map::remove)
                .collect(toList());
    }
278624
public static <T> int detectLastIndex(List<T> list, Predicate<? super T> predicate)
    {
        if (list instanceof RandomAccess)
        {
            return RandomAccessListIterate.detectLastIndex(list, predicate);
        }
        int size = list.size();
        int i = size - 1;
        ListIterator<T> reverseIterator = list.listIterator(size);
        while (reverseIterator.hasPrevious())
        {
            if (predicate.accept(reverseIterator.previous()))
            {
                return i;
            }
            i--;
        }
        return -1;
    }
499608
public function any(callable $predicate)
    {
        foreach ($this->each() as $k => $v) {
            if ($predicate($v, $k)) {
                return true;
            }
        }
        return false;
    }
576520
private RunList<R> limit(final CountingPredicate<R> predicate) {
        size = null;
        first = null;
        final Iterable<R> nested = base;
        base = new Iterable<R>() {
            public Iterator<R> iterator() {
                return hudson.util.Iterators.limit(nested.iterator(),predicate);
            }

            @Override
            public String toString() {
                return Iterables.toString(this);
            }
        };
        return this;
    }
512720
public AutoscalePolicyFilter where(Predicate<AutoscalePolicyMetadata> predicate) {
        checkNotNull(predicate, "Predicate must be not a null");

        this.predicate = this.predicate.and(predicate);

        return this;
    }
641292
public static <T> Predicate<T> not(Predicate<T> predicate) {
        dbc.precondition(predicate != null, "cannot negate a null predicate");
        return predicate.negate();
    }
610692
@Nonnull
  public EChange removeRules (@Nonnull final Predicate <? super ICSSTopLevelRule> aFilter)
  {
    return EChange.valueOf (m_aRules.removeIf (aFilter));
  }
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
753580
public boolean removeItem (T item)
    {
        int index = _items.indexOf(item);
        if (index == -1) {
            return false;
        }
        _items.remove(index);
        removeItem(index);
        return true;
    }