Here you can find the source of indexOfType(List> list, Class type)
public static int indexOfType(List<?> list, Class type)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static int indexOfType(List<?> list, Class type) { for (int idx = 0; idx < list.size(); idx++) { if (type.isInstance(list.get(idx))) { return idx; }/*from ww w . ja v a 2s . c om*/ } return -1; } }