public static <T> int detectLastIndex(ArrayList<T> list, Predicate<? super T> predicate)
    {
        int size = list.size();
        if (ArrayListIterate.isOptimizableArrayList(list, size))
        {
            T[] elements = ArrayListIterate.getInternalArray(list);
            for (int i = size - 1; i >= 0; i--)
            {
                if (predicate.accept(elements[i]))
                {
                    return i;
                }
            }
            return -1;
        }
        return RandomAccessListIterate.detectLastIndex(list, predicate);
    }
public static < T > int detectLastIndex ( ArrayList < T > list , Predicate < ? super T > predicate ) { int size = list . size ( ) ; if ( ArrayListIterate . isOptimizableArrayList ( list , size ) ) { T [ ] elements = ArrayListIterate . getInternalArray ( list ) ; for ( int i = size - 1 ; i >= 0 ; i -- ) { if ( predicate . accept ( elements [ i ] ) ) { return i ; } } return - 1 ; } return RandomAccessListIterate . detectLastIndex ( list , predicate ) ; }
@see ListIterate#detectLastIndex(List, Predicate)