core/src/main/java/com/orientechnologies/common/util/OCollections.java
public static <T> int indexOf(final List<T> list, final T object, final Comparator<T> comparator) {
    int i = 0;
    for (final T item : list) {
      if (comparator.compare(item, object) == 0)
        return i;
      i++;
    }
    return -1;
  }
public static <T> int indexOf(final List<T> list, final T object, final Comparator<T> comparator) {
    int i = 0;
    for (final T item : list) {
      if (comparator.compare(item, object) == 0)
        return i;
      i++;
    }
    return -1;
  }
public static < T > int indexOf ( final List < T > list , final T object , final Comparator < T > comparator ) { int i = 0 ; for ( final T item : list ) { if ( comparator . compare ( item , object ) == 0 ) return i ; i ++ ; } return - 1 ; }
This method is used to find item in collection using passed in comparator. Only 0 value (requested object is found) returned by
comparator is taken into account the rest is ignored.


@param list
List in which value should be found.
@param object
Object to find.
@param comparator
Comparator is sued for search.
@param <T>
Type of collection elements.
@return Index of found item or <code>-1</code> otherwise.
This method is used to find item in collection using passed in comparator . Only 0 value ( requested object is found ) returned by comparator is taken into account the rest is ignored .