public int lastIndexOf(int o) {
    IntListIterator e = listIterator(size());

    while (e.hasPrevious()) if (o == e.previous()) return e.nextIndex();

    return -1;
  }
  public int indexOf(int o) {
    IntListIterator e = listIterator();

    while (e.hasNext()) if (o == e.next()) return e.previousIndex();

    return -1;
  }
 protected void removeRange(int fromIndex, int toIndex) {
   IntListIterator it = listIterator(fromIndex);
   for (int i = 0, n = toIndex - fromIndex; i < n; i++) {
     it.next();
     it.remove();
   }
 }
 public int lastIndexOf(int element) {
   for (IntListIterator iter = listIterator(size()); iter.hasPrevious(); ) {
     if (iter.previous() == element) {
       return iter.nextIndex();
     }
   }
   return -1;
 }
  public int hashCode() {
    int hashCode = 1;
    IntListIterator i = listIterator();

    while (i.hasNext()) {
      int obj = i.next();
      hashCode = 31 * hashCode + obj;
    }
    return hashCode;
  }
  public boolean remove(int o) {
    IntListIterator e = listIterator();

    while (e.hasNext()) {
      if (o == e.next()) {
        e.remove();
        return true;
      }
    }

    return false;
  }
  public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof IntList)) return false;

    IntListIterator e1 = listIterator();
    IntListIterator e2 = ((IntList) o).listIterator();
    while (e1.hasNext() && e2.hasNext()) {
      if (e1.next() != e2.next()) return false;
    }
    return !(e1.hasNext() || e2.hasNext());
  }
  public boolean contains(int o) {
    IntListIterator e = listIterator();

    while (e.hasNext()) if (o == e.next()) return true;
    return false;
  }
 public int[] toArray() {
   int[] result = new int[size()];
   IntListIterator e = listIterator();
   for (int i = 0; e.hasNext(); i++) result[i] = e.next();
   return result;
 }