code: public static <T> int detectIndex(Iterable<T> iterable, Predicate<? super T> predicate)
      {
          if (iterable instanceof ArrayList<?>)
          {
              return ArrayListIterate.detectIndex((ArrayList<T>) iterable, predicate);
          }
          if (iterable instanceof List<?>)
          {
              return ListIterate.detectIndex((List<T>) iterable, predicate);
          }
          if (iterable != null)
          {
              return IterableIterate.detectIndex(iterable, predicate);
          }
          throw new IllegalArgumentException("Cannot perform detectIndex on null");
      }
docs: Searches for the first occurrence where the predicate evaluates to true, returns -1 if the predicate does not evaluate to true.