Returns the elements of {@code unfiltered} that satisfy a predicate. The
resulting iterable's iterator does not support {@code remove()}.
518963
public static <T> Iterable<T> filter(
      final Iterable<T> unfiltered, final Predicate<? super T> predicate) {
    checkNotNull(unfiltered);
    checkNotNull(predicate);
    return new FluentIterable<T>() {
      @Override
      public Iterator<T> iterator() {
        return Iterators.filter(unfiltered.iterator(), predicate);
      }
    };
  }
1066026
@NotNull
    public DoubleStream filterNot(@NotNull final DoublePredicate predicate) {
        return filter(DoublePredicate.Util.negate(predicate));
    }
831480
public synchronized ArrayList<V> removeAll(@Nullable Predicate<K> predicate) {
    ArrayList<V> oldValues = new ArrayList<>();
    Iterator<LinkedHashMap.Entry<K, V>> iterator = mMap.entrySet().iterator();
    while (iterator.hasNext()) {
      LinkedHashMap.Entry<K, V> entry = iterator.next();
      if (predicate == null || predicate.apply(entry.getKey())) {
        oldValues.add(entry.getValue());
        mSizeInBytes -= getValueSizeInBytes(entry.getValue());
        iterator.remove();
      }
    }
    return oldValues;
  }
1051646
public <E extends Exception> boolean allMatch(Try.BooleanPredicate<E> filter) throws E {
        return allMatch(0, size(), filter);
    }
641292
public static <T> Predicate<T> not(Predicate<T> predicate) {
        dbc.precondition(predicate != null, "cannot negate a null predicate");
        return predicate.negate();
    }
158814
public static Predicates<Object> notIn(Iterable<?> iterable)
    {
        if (iterable instanceof SetIterable<?>)
        {
            return new NotInSetIterablePredicate((SetIterable<?>) iterable);
        }
        if (iterable instanceof Set<?>)
        {
            return new NotInSetPredicate((Set<?>) iterable);
        }
        if (iterable instanceof Collection<?> && ((Collection<?>) iterable).size() <= SMALL_COLLECTION_THRESHOLD)
        {
            return new NotInCollectionPredicate((Collection<?>) iterable);
        }
        return new NotInSetIterablePredicate(UnifiedSet.newSet(iterable));
    }
1072413
@NotNull
    public OptionalBoolean filterNot(@NotNull BooleanPredicate predicate) {
        return filter(BooleanPredicate.Util.negate(predicate));
    }
369578
public static <E> Collection<E> filterColl(Iterable<E> coll,
					       Predicate<E> pred,
					       Collection<E> newColl) {
	for(E elem : coll) {
	    if(pred.check(elem)) {
		newColl.add(elem);
	    }
	}
	return newColl;
    }
1078372
public int remove(Filter filter)
    {
        int size = trie.size();
        for (Map.Entry<String, V> entry : entrySet())
        {
            if (filter.remove(entry))
            {
                trie.remove(entry.getKey());
            }
        }

        return size - trie.size();
    }
622066
public Iterable<T> filter(final Iterable<T> iterable) {
        return new Iterable<T>() {

            @Override
            public Iterator<T> iterator() {
                return filter(iterable.iterator());
            }
        };
    }
1146599
public final FluentCloseableIterable<T> filter(Predicate<? super T> predicate) {
        return from(CloseableIterables.filter(this, predicate));
    }
140209
public static <E> Object result(final Iterable<E> iterable, final Predicate<E> pred) {
        for (E element : iterable) {
            if (pred.test(element)) {
                if (element instanceof Map.Entry) {
                    if (((Map.Entry) element).getValue() instanceof Supplier) {
                        return ((Supplier) ((Map.Entry) element).getValue()).get();
                    }
                    return ((Map.Entry) element).getValue();
                }
                return element;
            }
        }
        return null;
    }
596715
public Gather<T> dropWhile(final Predicate<T> predicate) {
    	final Iterator<T> it = each().iterator();
        return from(new AbstractIterator<T>() {
            private boolean done = false;
            protected T computeNext() {
                if (!done) {
                    while (it.hasNext()) {
                        T t = it.next();
                        if (!predicate.apply(t)) {
                            done = true;
                            return t;
                        }
                    }
                }
                if (it.hasNext()) {
                    return it.next();
                }
                else {
                    return endOfData();
                }
            }
        });
    }
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }
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;
    }
1329194
public static <T> Predicate<Iterable<T>> allPredicate(final Predicate<T> pred) {
    return new Predicate<Iterable<T>>() {
      @Override
      public boolean apply(final Iterable<T> iter) {
        return com.google.common.collect.Iterables.all(iter, pred);
      }
    };
  }
974298
public <E extends Exception> boolean noneMatch(Try.IntPredicate<E> filter) throws E {
        return noneMatch(0, size(), filter);
    }