An implementation of {@link List#indexOf(Object)}.
779769
static int indexOfImpl(List<?> list, @Nullable Object element) {
    ListIterator<?> listIterator = list.listIterator();
    while (listIterator.hasNext()) {
      if (Objects.equal(element, listIterator.next())) {
        return listIterator.previousIndex();
      }
    }
    return -1;
  }
422681
public final int indexOf(@ColorInt final int color) {
        for (int i = 0; i < colorPalette.length; i++) {
            if (colorPalette[i] == color) {
                return i;
            }
        }

        return -1;
    }
533373
function indexOf(array, searchElement, fromIndex)
    {
        fromIndex = Math.max(fromIndex || 0, 0);

        for (var i = fromIndex; i < array.length; i++)
            if(array[i] == searchElement)
                return i;

        return -1;
    }
768537
int indexOf(byte[] data, int dataLength, byte[] pattern, int dataOffset) {
        int[] failure = computeFailure(pattern);
        int j = 0;
        if (data.length == 0)
            return -1;
        //final int dataLength = data.length;
        final int patternLength = pattern.length;
        for (int i = dataOffset; i < dataLength; i++) {
            while (j > 0 && pattern[j] != data[i])
                j = failure[j - 1];
            if (pattern[j] == data[i])
                j++;
            if (j == patternLength)
                return i - patternLength + 1;
        }
        return -1;
    }
292569
protected int indexOf(String text, String... values) {
        int answer = -1;
        for (String value : values) {
            int idx = text.indexOf(value);
            if (idx >= 0) {
                if (answer < 0 || idx < answer) {
                    answer = idx;
                }
            }
        }
        return answer;
    }
1139422
public static int indexOf(String source, String target, int fromIndex, int toIndex) {
		if(fromIndex>toIndex) throw new IllegalArgumentException("fromIndex>toIndex: fromIndex="+fromIndex+", toIndex="+toIndex);

		int sourceCount = source.length();

		// This line makes it different than regular String indexOf method.
		if(toIndex<sourceCount) sourceCount = toIndex;

		int targetCount = target.length();

		if (fromIndex >= sourceCount) {
			return (targetCount == 0 ? sourceCount : -1);
	}
		if (fromIndex < 0) {
			fromIndex = 0;
		}
	if (targetCount == 0) {
		return fromIndex;
	}

		char first  = target.charAt(0);
		int max = sourceCount - targetCount;

		for (int i = fromIndex; i <= max; i++) {
			/* Look for first character. */
			if (source.charAt(i) != first) {
				while (++i <= max && source.charAt(i) != first) {
					// Intentionally empty
				}
			}

			/* Found first character, now look at the rest of v2 */
			if (i <= max) {
				int j = i + 1;
				int end = j + targetCount - 1;
				for (int k = 1; j < end && source.charAt(j) == target.charAt(k); j++, k++) {
					// Intentionally empty
				}

				if (j == end) {
					/* Found whole string. */
					return i;
				}
			}
		}
		return -1;
	}
761047
public static int indexAny(String target, Integer fromIndex, String... indexWith) {
		return indexAny(target, fromIndex, Arrays.asList(indexWith));
	}
14417
public static <T> PositionFactory<Iterable<? extends T>, T> atIndex(final int index) {
        return new PositionFactory<Iterable<? extends T>, T>(index) {

            @Override
            public String toString() {
                return String.format("Element [%s]", index);
            }

            @Override
            protected <P> Type evaluateElementType(Position<P> parentPosition) {
                return TypeUtils.getTypeArguments(parentPosition.getType(), Iterable.class)
                    .get(Iterable.class.getTypeParameters()[0]);
            }
        };
    }
479232
public static int indexOfNull (Object[] list)
    {
        if (list != null) {
            for (int ii=0, nn = list.length; ii < nn; ii++) {
                if (list[ii] == null) {
                    return ii;
                }
            }
        }
        return -1;
    }
320306
public int indexOf(byte[] srcBytes, byte[] searchBytes, int startIndex) {
		final int endIndex = srcBytes.length - 1;
		return indexOf(srcBytes, searchBytes, startIndex, endIndex);
	}
149634
public int indexOf(int c) {
        if (c < MIN_VALUE || c > MAX_VALUE) {
            throw new IllegalArgumentException("Invalid code point U+" + Utility.hex(c, 6));
        }
        int i = 0;
        int n = 0;
        for (;;) {
            int start = list[i++];
            if (c < start) {
                return -1;
            }
            int limit = list[i++];
            if (c < limit) {
                return n + c - start;
            }
            n += limit - start;
        }
    }
429594
public int indexOfKey(Object key) {
        return key == null ? indexOfNull() : indexOf(key, key.hashCode());
    }
1128398
@Pure
	public int indexOf(BusItineraryHalt bushalt) {
		if (bushalt == null) {
			return -1;
		}
		if (bushalt.isValidPrimitive()) {
			return ListUtil.indexOf(this.validHalts, VALID_HALT_COMPARATOR, bushalt);
		}
		int idx = ListUtil.indexOf(this.invalidHalts, INVALID_HALT_COMPARATOR, bushalt);
		if (idx >= 0) {
			idx += this.validHalts.size();
		}
		return idx;
	}
1360941
function indexOf(srcArr, predicate) {
      for (var i = 0; i < srcArr.length; i++) {
        if (isObj(predicate)) {
          if (keys(predicate).every(
            function (k) { return srcArr[i][k] === predicate[k]; })
          ) return i;
        } else if (isFun(predicate)) {
          if (predicate(srcArr[i])) return i;
        }
      }
      return srcArr.indexOf(predicate);
    }
1131957
public static int indexOf(List<Node> list , int value ) {

		for (int i = 0; i < list.size(); i++) {
			if( list.get(i).which == value )
				return i;
		}

		return -1;
	}
13760
private int indexOf(SQSMessageIdentifier findMessage) {
        int i = 0;
        for (SQSMessageIdentifier sqsMessageIdentifier : unAckMessages) {
            i++;
            if (sqsMessageIdentifier.equals(findMessage)) {
                return i;
            }
        }
        return -1;
    }
1364578
function _indexOf(a,s){
	// Do we need the hack?
	if(a.indexOf){
		return a.indexOf(s);
	}

	for(var j=0;j<a.length;j++){
		if(a[j]===s){
			return j;
		}
	}
	return -1;
}