Пример #1
0
 public T next() {
   if (position == null) {
     position = list.first();
   } else {
     position = list.next(position);
   }
   return position.element();
 }
Пример #2
0
 public boolean hasNext() {
   if (position == null) {
     return !list.isEmpty();
   } else {
     try {
       list.next(position);
     } catch (RuntimeException e) {
       return false;
     }
   }
   return true;
 }