Returns a stateful <code>Predicate</code> which should not be used in parallel stream.

@param predicate
@return
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }
773629
public static <T> Predicate<T> always() {
        return new Predicate<T>() {
            @Override
            public boolean test( T input ) {
                return true;
            }
        };
    }
224341
public LoadBalancerFilter dataCentersWhere(Predicate<DataCenterMetadata> predicate) {
        checkNotNull(predicate, "Predicate must be not a null");

        dataCenterFilter.where(predicate);
        return this;
    }
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);
      }
    };
  }
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();
  }
847922
@NotNull
    public Optional<T> filter(@NotNull Predicate<? super T> predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : Optional.<T>empty();
    }
1047484
public WorkUnitStream filter(Predicate<WorkUnit> predicate) {
    if (this.materializedWorkUnits == null) {
      return new BasicWorkUnitStream(this, Iterators.filter(this.workUnits, predicate), null);
    } else {
      return new BasicWorkUnitStream(this, null, Lists.newArrayList(Iterables.filter(this.materializedWorkUnits, predicate)));
    }
  }
239800
public static <T> Iterator<T> filteringIterator(
        Iterator<? extends T> iterator, 
        Predicate<? super T> predicate)
    {
        Objects.requireNonNull(iterator, "The iterator is null");
        Objects.requireNonNull(predicate, "The predicate is null");
        return new FilteringIterator<T>(iterator, predicate);
    }
965893
public static <T, E extends Exception> Predicate<T> sneaked(SneakyPredicate<T, E> predicate) {
    return t -> {
      @SuppressWarnings("unchecked")
      SneakyPredicate<T, RuntimeException> castedSneakyPredicate =
          (SneakyPredicate<T, RuntimeException>) predicate;
      return castedSneakyPredicate.test(t);
    };
  }
1136058
public final predicate_return predicate() throws RecognitionException {
        predicate_return retval = new predicate_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token char_literal7=null;
        Token char_literal9=null;
        Token TRUE16=null;
        Token FALSE17=null;
        filter_return filter8 =null;

        comparison_function_return comparison_function10 =null;

        between_predicate_return between_predicate11 =null;

        in_predicate_return in_predicate12 =null;

        null_predicate_return null_predicate13 =null;

        regex_predicate_return regex_predicate14 =null;

        exists_predicate_return exists_predicate15 =null;


        CommonTree char_literal7_tree=null;
        CommonTree char_literal9_tree=null;
        CommonTree TRUE16_tree=null;
        CommonTree FALSE17_tree=null;
        RewriteRuleTokenStream stream_FALSE=new RewriteRuleTokenStream(adaptor,"token FALSE");
        RewriteRuleTokenStream stream_TRUE=new RewriteRuleTokenStream(adaptor,"token TRUE");
        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
        RewriteRuleTokenStream stream_34=new RewriteRuleTokenStream(adaptor,"token 34");
        RewriteRuleSubtreeStream stream_filter=new RewriteRuleSubtreeStream(adaptor,"rule filter");
        try {
            // MessageFilter.g:117:2: ( '(' filter ')' -> filter | comparison_function | between_predicate | in_predicate | null_predicate | regex_predicate | exists_predicate | TRUE -> TRUE | FALSE -> FALSE )
            int alt5=9;
            switch ( input.LA(1) ) {
            case 33:
                {
                alt5=1;
                }
                break;
            case XPATH_FUN_NAME:
                {
                int LA5_2 = input.LA(2);

                if ( (LA5_2==33) ) {
                    int LA5_6 = input.LA(3);

                    if ( (LA5_6==STRING) ) {
                        int LA5_7 = input.LA(4);

                        if ( (LA5_7==34) ) {
                            switch ( input.LA(5) ) {
                            case EQUALS:
                            case GE:
                            case GT:
                            case LE:
                            case LT:
                            case NOT_EQUALS:
                                {
                                alt5=2;
                                }
                                break;
                            case BETWEEN:
                                {
                                alt5=3;
                                }
                                break;
                            case IN:
                                {
                                alt5=4;
                                }
                                break;
                            case IS:
                                {
                                alt5=5;
                                }
                                break;
                            case MATCHES:
                                {
                                alt5=6;
                                }
                                break;
                            case EXISTS:
                                {
                                alt5=7;
                                }
                                break;
                            default:
                                NoViableAltException nvae =
                                    new NoViableAltException("", 5, 8, input);

                                throw nvae;

                            }

                        }
                        else {
                            NoViableAltException nvae =
                                new NoViableAltException("", 5, 7, input);

                            throw nvae;

                        }
                    }
                    else {
                        NoViableAltException nvae =
                            new NoViableAltException("", 5, 6, input);

                        throw nvae;

                    }
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 5, 2, input);

                    throw nvae;

                }
                }
                break;
            case EXISTS:
                {
                alt5=7;
                }
                break;
            case TRUE:
                {
                alt5=8;
                }
                break;
            case FALSE:
                {
                alt5=9;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;

            }

            switch (alt5) {
                case 1 :
                    // MessageFilter.g:117:4: '(' filter ')'
                    {
                    char_literal7=(Token)match(input,33,FOLLOW_33_in_predicate448);
                    stream_33.add(char_literal7);


                    pushFollow(FOLLOW_filter_in_predicate450);
                    filter8=filter();

                    state._fsp--;

                    stream_filter.add(filter8.getTree());

                    char_literal9=(Token)match(input,34,FOLLOW_34_in_predicate452);
                    stream_34.add(char_literal9);


                    // AST REWRITE
                    // elements: filter
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 117:19: -> filter
                    {
                        adaptor.addChild(root_0, stream_filter.nextTree());

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // MessageFilter.g:118:3: comparison_function
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_comparison_function_in_predicate463);
                    comparison_function10=comparison_function();

                    state._fsp--;

                    adaptor.addChild(root_0, comparison_function10.getTree());

                    }
                    break;
                case 3 :
                    // MessageFilter.g:119:3: between_predicate
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_between_predicate_in_predicate469);
                    between_predicate11=between_predicate();

                    state._fsp--;

                    adaptor.addChild(root_0, between_predicate11.getTree());

                    }
                    break;
                case 4 :
                    // MessageFilter.g:120:3: in_predicate
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_in_predicate_in_predicate475);
                    in_predicate12=in_predicate();

                    state._fsp--;

                    adaptor.addChild(root_0, in_predicate12.getTree());

                    }
                    break;
                case 5 :
                    // MessageFilter.g:121:3: null_predicate
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_null_predicate_in_predicate481);
                    null_predicate13=null_predicate();

                    state._fsp--;

                    adaptor.addChild(root_0, null_predicate13.getTree());

                    }
                    break;
                case 6 :
                    // MessageFilter.g:122:3: regex_predicate
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_regex_predicate_in_predicate487);
                    regex_predicate14=regex_predicate();

                    state._fsp--;

                    adaptor.addChild(root_0, regex_predicate14.getTree());

                    }
                    break;
                case 7 :
                    // MessageFilter.g:123:3: exists_predicate
                    {
                    root_0 = (CommonTree)adaptor.nil();


                    pushFollow(FOLLOW_exists_predicate_in_predicate493);
                    exists_predicate15=exists_predicate();

                    state._fsp--;

                    adaptor.addChild(root_0, exists_predicate15.getTree());

                    }
                    break;
                case 8 :
                    // MessageFilter.g:124:3: TRUE
                    {
                    TRUE16=(Token)match(input,TRUE,FOLLOW_TRUE_in_predicate499);
                    stream_TRUE.add(TRUE16);


                    // AST REWRITE
                    // elements: TRUE
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 124:8: -> TRUE
                    {
                        adaptor.addChild(root_0,
                        new TrueValueTreeNode(stream_TRUE.nextToken())
                        );

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 9 :
                    // MessageFilter.g:125:3: FALSE
                    {
                    FALSE17=(Token)match(input,FALSE,FOLLOW_FALSE_in_predicate511);
                    stream_FALSE.add(FALSE17);


                    // AST REWRITE
                    // elements: FALSE
                    // token labels:
                    // rule labels: retval
                    // token list labels:
                    // rule list labels:
                    // wildcard labels:
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

                    root_0 = (CommonTree)adaptor.nil();
                    // 125:9: -> FALSE
                    {
                        adaptor.addChild(root_0,
                        new FalseValueTreeNode(stream_FALSE.nextToken())
                        );

                    }


                    retval.tree = root_0;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
1116805
public static <T> Collector<T, ?, Optional<T>> onlyOne(final Predicate<? super T> predicate) {
        final Collector<T, ?, Optional<T>> downstream = onlyOne();

        return filtering(predicate, downstream);
    }
307756
public static <T> ActionPredicate<T> fromPredicate(final Predicate<T> predicate) {
	return new ActionPredicate<T>() {
	    public boolean actionPredicate(T obj) {
		return predicate.check(obj);
	    }
	};
    }
1328043
public static <T> Predicate<T> notNull() {
        return new Predicate<T>() {
            @Override
            public boolean test(T testValue) {
                return testValue != null;
            }
        };
    }
710109
@NotNull
    public LongStream filterNot(@NotNull final LongPredicate predicate) {
        return filter(LongPredicate.Util.negate(predicate));
    }
1339370
private static <X> Predicate<X> isCandidate(final Iterable<List<X>> remainingInputs) {
        return new Predicate<X>() {

            Predicate<List<X>> headIs(final X c) {
                return new Predicate<List<X>>() {
                    public boolean apply(List<X> input) {
                        return !input.isEmpty() && c.equals(input.get(0));
                    }
                };
            }

            Predicate<List<X>> tailContains(final X c) {
                return new Predicate<List<X>>() {
                    public boolean apply(List<X> input) {
                        return input.indexOf(c) > 0;
                    }
                };
             }

             public boolean apply(final X c) {
                 return any(remainingInputs, headIs(c)) &&
                       all(remainingInputs, not(tailContains(c)));
             }
        };
    }
292461
@CheckResult
    @NonNull
    public final Data<T> filter(@NonNull Predicate<? super T> predicate) {
        return new FilterData<>(this, predicate);
    }
854646
@CheckReturnValue
  public ScannerSupplier filter(Predicate<? super BugCheckerInfo> predicate) {
    ImmutableSet.Builder<String> disabled = ImmutableSet.builder();
    for (BugCheckerInfo check : getAllChecks().values()) {
      if (!predicate.apply(check)) {
        disabled.add(check.canonicalName());
      }
    }
    return new ScannerSupplierImpl(getAllChecks(), severities(), disabled.build(), getFlags());
  }