public int[] indices(Collection<E> elems) {
    int[] indices = new int[elems.size()];
    int i = 0;
    for (E elem : elems) {
      indices[i++] = indexOf(elem);
    }
    return indices;
  }
public int [ ] indices ( Collection < E > elems ) { int [ ] indices = new int [ elems . size ( ) ] ; int i = 0 ; for ( E elem : elems ) { indices [ i ++ ] = indexOf ( elem ) ; } return indices ; }
Returns the index of each elem in a List.
@param elems The list of items
@return An array of indices