Here you can find the source of indexOfIdentical(List list, Object value)
public static int indexOfIdentical(List list, Object value)
//package com.java2s; /*/* w w w . j a v a 2s .co m*/ * This file is part of the jasm project (http://code.google.com/p/jasm). * * This file is licensed to you under the BSD License; You may not use * this file except in compliance with the License. See the LICENSE.txt * file distributed with this work for a copy of the License and information * regarding copyright ownership. */ import java.util.List; public class Main { /** * Returns the index in {@code list} of the first occurrence identical to {@code value}, or -1 if * {@code list} does not contain {@code value}. More formally, returns the lowest index * {@code i} such that {@code (list.get(i) == value)}, or -1 if there is no such index. */ public static int indexOfIdentical(List list, Object value) { int i = 0; for (Object element : list) { if (element == value) { return i; } ++i; } return -1; } }