Returns a predicate that evaluates to {@code true} if its
argument is a member of {@code c}.
192055
public static <T> Predicate<T> in(final Collection<T> c) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T obj) {
        return c.contains(obj);
      }
    };
  }
1353765
@Override
    public boolean contains(int c) {
        if (c < MIN_VALUE || c > MAX_VALUE) {
            throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(c, 6));
        }
        if (bmpSet != null) {
            return bmpSet.contains(c);
        }
        if (stringSpan != null) {
            return stringSpan.contains(c);
        }

        /*
        // Set i to the index of the start item greater than ch
        // We know we will terminate without length test!
        int i = -1;
        while (true) {
            if (c < list[++i]) break;
        }
         */

        int i = findCodePoint(c);

        return ((i & 1) != 0); // return true if odd
    }
474866
public static <T> Predicate<T> in(final Iterable<T> it) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T obj) {
        for (T elem : it) {
          if (Objects.equal(elem, obj)) {
            return true;
          }
        }
        return false;
      }
    };
  }
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;
    }
3098
public static Validation<String> contains(String c) {
        return contains(c, I18N_MAP.get(i18nPrefix + "CONTAINS"));
    }
442075
public static BooleanOperation value() {
		JcValue val = new WhenJcValue();
		BooleanOperation ret = P.valueOf(val);
		ASTNode an = APIObjectAccess.getAstNode(ret);
		an.setClauseType(ClauseType.WHEN);
		return ret;
	}
941978
@SuppressWarnings("unchecked")
  public static <S, T extends S> Predicate<T> narrow(Predicate<S> p) {
    return (Predicate<T>) p;
  }
1235529
public static <T> Predicate<T> trueInstance ()
    {
        @SuppressWarnings("unchecked") Predicate<T> pred = (Predicate<T>)TRUE_INSTANCE;
        return pred;
    }
1107833
public static <K, V> Predicate<Map<K, V>> anyValue(Predicate<? super V> p) {
    return forValues(Predicates.<V>any(p));
  }
1142767
@Override
    public MonadicBinding<T> filter(Predicate<? super T> p) {
        return EasyBind.filter(delegate, p);
    }
209777
public static <T extends Comparable<? super T>> int compare(T c1, T c2) {
		return CompareUtil.compare(c1, c2);
	}
1143716
static <R> BiPredicate<R, Throwable> resultPredicateFor(Predicate<R> resultPredicate) {
    return (t, u) -> {
      if (u == null) {
        return resultPredicate.test(t);
      } else {
        // resultPredicate is only defined over the success type.
        // It doesn't know how to handle a failure of type Throwable,
        // so we return false here.
        return false;
      }
    };
  }
1107951
function AnyAllPredicate(op, expr, pred) {
      this.op = this._resolveOp(op);
      this.exprSource = expr;
      // this.expr will not be resolved until validate is called
      this.pred = Predicate(pred);
    }
1097984
public static <T> Predicate<T> contains(final Iterable<T> iterable) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return Iterables.contains(iterable, testValue);
            }
        };
    }
67149
public static <T> Predicate<T> predicate(CheckedPredicate<T> predicate) {
        return predicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
1324302
@Nonnull
	public <V extends T> LObjBoolPredicateBuilder<T> aCase(Class<V> argC1, LObjBoolPredicate<V> function) {
		PartialCaseWithBoolProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)));

		pc.evaluate(function);
		return self();
	}
888064
function find (c, predicate) {
        for (var i = 0; i < c.length; i++) {
            if (predicate(c[i]))
                return c[i];
        }
        return null;
    }