code: public Object getNextElement() {
          Object element = null;
          while (currentIndex+1 < endIndex && element == null) {
              currentIndex++;
              element = getElement();
          }
          return element;      
      }
docs: Returns the next available element of primary key collection, or null if
  there are no more elements to return.
  
  @return the next available element.