Sneaky throws a Predicate lambda.

@param predicate Predicate that can throw an exception
@param <T> type of first argument
@return a Predicate as defined in java.util.function
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);
    };
  }
1097335
public static <T, P, R extends Collection<T>> R rejectWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter,
            R targetCollection)
    {
        if (iterable instanceof RichIterable)
        {
            return ((RichIterable<T>) iterable).rejectWith(predicate, parameter, targetCollection);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.rejectWith(
                    (ArrayList<T>) iterable,
                    predicate,
                    parameter,
                    targetCollection);
        }
        if (iterable instanceof RandomAccess)
        {
            return RandomAccessListIterate.rejectWith((List<T>) iterable, predicate, parameter, targetCollection);
        }
        if (iterable != null)
        {
            return IterableIterate.rejectWith(iterable, predicate, parameter, targetCollection);
        }
        throw new IllegalArgumentException("Cannot perform a rejectWith on null");
    }
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
983104
public static <T> Predicate<T> or(Predicate<? super T> first, Predicate<? super T> second) {
		return new OrPredicate<>(Predicates.<T> asList(Objects.requireNonNull(first), Objects.requireNonNull(second)));
	}
1218321
public static <T> LazyIterable<T> reject(Iterable<T> iterable, Predicate<? super T> predicate)
    {
        return new RejectIterable<T>(iterable, predicate);
    }
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);
    }
462083
function filter(pred, m) {
  if(!isPredOrFunc(pred)) {
    throw new TypeError('filter: Pred or predicate function required for first argument')
  }

  const fn =
    x => predOrFunc(pred, x)

  if(m && isFunction(m.filter)) {
    return m.filter(fn)
  }

  if(m && isObject(m)) {
    return object.filter(fn, m)
  }

  throw new TypeError('filter: Filterable or Object required for second argument')
}
115176
public static <T> Predicate<T> negate(
        Predicate<? super T> p)
    {
        Objects.requireNonNull(p, "The predicate is null");
        return new Predicate<T>()
        {
            @Override
            public boolean test(T t)
            {
                return !p.test(t);
            }
            
            @Override
            public String toString()
            {
                return "!(" + p + ")";
            }
        };
    }
579702
public static <T, P> int detectIndexWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super P> predicate,
            P parameter)
    {
        if (iterable instanceof ArrayList<?>)
        {
            return ArrayListIterate.detectIndexWith((ArrayList<T>) iterable, predicate, parameter);
        }
        if (iterable instanceof List<?>)
        {
            return ListIterate.detectIndexWith((List<T>) iterable, predicate, parameter);
        }
        if (iterable != null)
        {
            return IterableIterate.detectIndexWith(iterable, predicate, parameter);
        }
        throw new IllegalArgumentException("Cannot perform detectIndexWith on null");
    }
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }
858906
@CheckReturnValue
    public FluentGenerator<T> filter(@Nonnull Predicate<T> predicate) {
        return from(new FilteringGenerator<>(delegate, checkNotNull(predicate)));
    }
1125353
@Incubating
    public static <T> T argLambdaThrowing(ThrowingPredicate<T> throwingLambda) {
        return argLambda(throwingLambda.uncheck(), "Inline lambda expression - add description in code to get more detailed error message");
    }
600691
public static <T, E extends Throwable> @NonNull Predicate<T> rethrowPredicate(final @NonNull ThrowingPredicate<T, E> predicate) {
    return predicate;
  }
715143
public static <A, B> Predicate<A> compose(Predicate<B> predicate, Function<A, ? extends B> function) {
		return t -> predicate.test(function.apply(t));
	}
40444
public static <T, IV> int detectIndexWith(List<T> list, Predicate2<? super T, ? super IV> predicate, IV injectedValue)
    {
        int size = list.size();
        for (int i = 0; i < size; i++)
        {
            if (predicate.accept(list.get(i), injectedValue))
            {
                return i;
            }
        }
        return -1;
    }
1119663
def __stringify_predicate(predicate):
    
    funname = getsource(predicate).strip().split(' ')[2].rstrip(',')
    params = 'None'

    # if args dig in the stack
    if '()' not in funname:
        stack = getouterframes(currentframe())
        for frame in range(0, len(stack)):
            if funname in str(stack[frame]):
                _, _, _, params = getargvalues(stack[frame][0])

    return "function: {} params: {}".format(funname, params)
566097
public final EventFilterParser.in_predicate_return in_predicate() throws RecognitionException {
        EventFilterParser.in_predicate_return retval = new EventFilterParser.in_predicate_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token IN58=null;
        Token char_literal59=null;
        Token STRING60=null;
        Token char_literal61=null;
        Token STRING62=null;
        Token char_literal63=null;
        Token IN65=null;
        Token char_literal66=null;
        Token NUMBER67=null;
        Token char_literal68=null;
        Token NUMBER69=null;
        Token char_literal70=null;
        EventFilterParser.path_function_return path_function57 =null;

        EventFilterParser.path_function_return path_function64 =null;


        CommonTree IN58_tree=null;
        CommonTree char_literal59_tree=null;
        CommonTree STRING60_tree=null;
        CommonTree char_literal61_tree=null;
        CommonTree STRING62_tree=null;
        CommonTree char_literal63_tree=null;
        CommonTree IN65_tree=null;
        CommonTree char_literal66_tree=null;
        CommonTree NUMBER67_tree=null;
        CommonTree char_literal68_tree=null;
        CommonTree NUMBER69_tree=null;
        CommonTree char_literal70_tree=null;
        RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
        RewriteRuleTokenStream stream_35=new RewriteRuleTokenStream(adaptor,"token 35");
        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
        RewriteRuleTokenStream stream_34=new RewriteRuleTokenStream(adaptor,"token 34");
        RewriteRuleTokenStream stream_STRING=new RewriteRuleTokenStream(adaptor,"token STRING");
        RewriteRuleTokenStream stream_NUMBER=new RewriteRuleTokenStream(adaptor,"token NUMBER");
        RewriteRuleSubtreeStream stream_path_function=new RewriteRuleSubtreeStream(adaptor,"rule path_function");
        try {
            // EventFilter.g:147:2: ( path_function IN '(' STRING ( ',' STRING )* ')' -> ^( IN path_function ( STRING )+ ) | path_function IN '(' NUMBER ( ',' NUMBER )* ')' -> ^( IN path_function ( NUMBER )+ ) )
            int alt10=2;
            int LA10_0 = input.LA(1);

            if ( (LA10_0==XPATH_FUN_NAME) ) {
                int LA10_1 = input.LA(2);

                if ( (LA10_1==33) ) {
                    int LA10_2 = input.LA(3);

                    if ( (LA10_2==STRING) ) {
                        int LA10_3 = input.LA(4);

                        if ( (LA10_3==34) ) {
                            int LA10_4 = input.LA(5);

                            if ( (LA10_4==IN) ) {
                                int LA10_5 = input.LA(6);

                                if ( (LA10_5==33) ) {
                                    int LA10_6 = input.LA(7);

                                    if ( (LA10_6==STRING) ) {
                                        alt10=1;
                                    }
                                    else if ( (LA10_6==NUMBER) ) {
                                        alt10=2;
                                    }
                                    else {
                                        NoViableAltException nvae =
                                            new NoViableAltException("", 10, 6, input);

                                        throw nvae;

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

                                    throw nvae;

                                }
                            }
                            else {
                                NoViableAltException nvae =
                                    new NoViableAltException("", 10, 4, input);

                                throw nvae;

                            }
                        }
                        else {
                            NoViableAltException nvae =
                                new NoViableAltException("", 10, 3, input);

                            throw nvae;

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

                        throw nvae;

                    }
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 10, 1, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 10, 0, input);

                throw nvae;

            }
            switch (alt10) {
                case 1 :
                    // EventFilter.g:147:4: path_function IN '(' STRING ( ',' STRING )* ')'
                    {
                    pushFollow(FOLLOW_path_function_in_in_predicate796);
                    path_function57=path_function();

                    state._fsp--;

                    stream_path_function.add(path_function57.getTree());

                    IN58=(Token)match(input,IN,FOLLOW_IN_in_in_predicate798);
                    stream_IN.add(IN58);


                    char_literal59=(Token)match(input,33,FOLLOW_33_in_in_predicate800);
                    stream_33.add(char_literal59);


                    STRING60=(Token)match(input,STRING,FOLLOW_STRING_in_in_predicate802);
                    stream_STRING.add(STRING60);


                    // EventFilter.g:147:32: ( ',' STRING )*
                    loop8:
                    do {
                        int alt8=2;
                        int LA8_0 = input.LA(1);

                        if ( (LA8_0==35) ) {
                            alt8=1;
                        }


                        switch (alt8) {
                    	case 1 :
                    	    // EventFilter.g:147:33: ',' STRING
                    	    {
                    	    char_literal61=(Token)match(input,35,FOLLOW_35_in_in_predicate805);
                    	    stream_35.add(char_literal61);


                    	    STRING62=(Token)match(input,STRING,FOLLOW_STRING_in_in_predicate807);
                    	    stream_STRING.add(STRING62);


                    	    }
                    	    break;

                    	default :
                    	    break loop8;
                        }
                    } while (true);


                    char_literal63=(Token)match(input,34,FOLLOW_34_in_in_predicate811);
                    stream_34.add(char_literal63);


                    // AST REWRITE
                    // elements: IN, STRING, path_function
                    // 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();
                    // 147:50: -> ^( IN path_function ( STRING )+ )
                    {
                        // EventFilter.g:147:53: ^( IN path_function ( STRING )+ )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        new StringInTreeNode(stream_IN.nextToken())
                        , root_1);

                        adaptor.addChild(root_1, stream_path_function.nextTree());

                        if ( !(stream_STRING.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_STRING.hasNext() ) {
                            adaptor.addChild(root_1,
                            new StringTreeNode(stream_STRING.nextToken())
                            );

                        }
                        stream_STRING.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    retval.tree = root_0;

                    }
                    break;
                case 2 :
                    // EventFilter.g:148:3: path_function IN '(' NUMBER ( ',' NUMBER )* ')'
                    {
                    pushFollow(FOLLOW_path_function_in_in_predicate836);
                    path_function64=path_function();

                    state._fsp--;

                    stream_path_function.add(path_function64.getTree());

                    IN65=(Token)match(input,IN,FOLLOW_IN_in_in_predicate838);
                    stream_IN.add(IN65);


                    char_literal66=(Token)match(input,33,FOLLOW_33_in_in_predicate840);
                    stream_33.add(char_literal66);


                    NUMBER67=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_in_predicate842);
                    stream_NUMBER.add(NUMBER67);


                    // EventFilter.g:148:31: ( ',' NUMBER )*
                    loop9:
                    do {
                        int alt9=2;
                        int LA9_0 = input.LA(1);

                        if ( (LA9_0==35) ) {
                            alt9=1;
                        }


                        switch (alt9) {
                    	case 1 :
                    	    // EventFilter.g:148:32: ',' NUMBER
                    	    {
                    	    char_literal68=(Token)match(input,35,FOLLOW_35_in_in_predicate845);
                    	    stream_35.add(char_literal68);


                    	    NUMBER69=(Token)match(input,NUMBER,FOLLOW_NUMBER_in_in_predicate847);
                    	    stream_NUMBER.add(NUMBER69);


                    	    }
                    	    break;

                    	default :
                    	    break loop9;
                        }
                    } while (true);


                    char_literal70=(Token)match(input,34,FOLLOW_34_in_in_predicate851);
                    stream_34.add(char_literal70);


                    // AST REWRITE
                    // elements: NUMBER, path_function, IN
                    // 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();
                    // 148:49: -> ^( IN path_function ( NUMBER )+ )
                    {
                        // EventFilter.g:148:52: ^( IN path_function ( NUMBER )+ )
                        {
                        CommonTree root_1 = (CommonTree)adaptor.nil();
                        root_1 = (CommonTree)adaptor.becomeRoot(
                        new NumericInTreeNode(stream_IN.nextToken())
                        , root_1);

                        adaptor.addChild(root_1, stream_path_function.nextTree());

                        if ( !(stream_NUMBER.hasNext()) ) {
                            throw new RewriteEarlyExitException();
                        }
                        while ( stream_NUMBER.hasNext() ) {
                            adaptor.addChild(root_1,
                            new NumberTreeNode(stream_NUMBER.nextToken())
                            );

                        }
                        stream_NUMBER.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }


                    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;
    }