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

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

    return -1;
  }
 public int lastIndexOf(int element) {
   for (IntListIterator iter = listIterator(size()); iter.hasPrevious(); ) {
     if (iter.previous() == element) {
       return iter.nextIndex();
     }
   }
   return -1;
 }