Here you can find the source of indexOfEquals(Collection
public static <T> int indexOfEquals(Collection<T> collection, T element)
//package com.java2s; import java.util.Collection; public class Main { public static <T> int indexOfEquals(Collection<T> collection, T element) { int pos = 0; for (T e : collection) { if (element.equals(e)) return pos; pos++;/* w w w.ja v a 2 s . co m*/ } return -1; } }