Here you can find the source of getIndicesOfItems(List superList, List sublist)
public static List<Integer> getIndicesOfItems(List superList, List sublist)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> getIndicesOfItems(List superList, List sublist) { List<Integer> list = new ArrayList<Integer>(sublist.size()); for (Object object : sublist) { list.add(superList.indexOf(object)); }// w w w . ja va 2 s. c om return list; } }