int (int element, int startIndex, int endIndex) { assertShort(element); if (startIndex < 0 || endIndex < startIndex || endIndex > mySize) { throw new IndexOutOfBoundsException("startIndex: "+startIndex+"; endIndex: "+endIndex+"; mySize: "+mySize); } for(int i = startIndex; i < endIndex; i++){ if (element == myData[i]) return i; } return -1; }