Here you can find the source of indexOf(List> list, Object element, int begin, int end)
public static int indexOf(List<?> list, Object element, int begin, int end)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static int indexOf(List<?> list, Object element, int begin, int end) { begin = Math.min(begin, list.size()); end = Math.min(end, list.size()); if (begin == 0 && end == list.size()) return list.indexOf(element); for (int i = begin; i < end; i++) { if (Objects.equals(element, list.get(i))) return i; }//from w ww . j av a 2 s .com return -1; } public static int indexOf(List<?> list, Object element, int begin) { return indexOf(list, element, begin, list.size()); } }