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