indexOf
Finds the first occurrence of the specified element. Equivalent to findFirst(e -> Objects.equals(e, element)).
Return
the first occurrence index, or -1 if not found
Parameters
element
the element to search for (may be null)
Finds the next occurrence of element starting from fromIndex (inclusive). Equivalent to findNext(fromIndex, e -> Objects.equals(e, element)).
Return
the next occurrence index, or -1 if not found
Parameters
fromIndex
the starting index (inclusive)
element
the element to search for (may be null)