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");
    }
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" ) ; }
Searches for the first occurrence where the predicate2 and parameter evaluates to true, returns -1 if the predicate2 and parameter do not evaluate to true.