code: public int indexOfFromTo(Object element, int from, int to, boolean testForEquality) {
  	if (size==0) return -1;
  	checkRangeFromTo(from, to, size);
  
  	Object[] theElements = elements;
  	if (testForEquality && element!=null) {
  		for (int i = from ; i <= to; i++) {
  		    if (element.equals(theElements[i])) {return i;} //found
  		}
  
  	}
  	else {
  		for (int i = from ; i <= to; i++) {
  		    if (element==theElements[i]) {return i;} //found
  		}
  	}
  	return -1; //not found
  }
docs: Returns the index of the first occurrence of the specified
  element. Returns <code>-1</code> if the receiver does not contain this element.
  Searches between <code>from</code>, inclusive and <code>to</code>, inclusive.
  
  Tests for equality or identity as specified by <code>testForEquality</code>.
  
  @param element element to search for.
  @param from the leftmost search position, inclusive.
  @param to the rightmost search position, inclusive.
  @param testForEquality if </code>true</code> -> test for equality, otherwise for identity.
  @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).