title: How to seek to a particular item in list iterator
body: <p>I want to seek the list iterator to a particular position to move one from there.</p>
  
  <p>I checked, If there anything available in the collections but I couldn't able to.</p>
  
  <p>Below is the implementation I tried which works fine, but I would like to know If there any better way to do this.</p>
  
  <pre><code>class FileIterator implements ListIterator&lt;String&gt;{
  
          ListIterator&lt;String&gt; iterator = null;
          List&lt;String&gt; fileList;
  
          public FileIterator(List&lt;String&gt; fileList) {
              this.fileList=fileList;
              iterator=fileList.listIterator();
          }
  
          @Override
          public void add(String data) {
              iterator.add(data);         
          }
  
          @Override
          public boolean hasNext() {
              return iterator.hasNext();
          }
  
          @Override
          public boolean hasPrevious() {
              return iterator.hasPrevious();
          }
  
          @Override
          public String next() {
              return iterator.next();
          }
  
          @Override
          public int nextIndex() {
              return iterator.nextIndex();
          }
  
          @Override
          public String previous() {
              return iterator.previous();
          }
  
          @Override
          public int previousIndex() {
              return iterator.previousIndex();
          }
  
          @Override
          public void remove() {
              iterator.remove();
          }
  
          @Override
          public void set(String data) {
              iterator.set(data);
          }
  
          public boolean seek(String data){
              iterator=fileList.listIterator();
              while(iterator.hasNext()){
                  if(iterator.next().equals(data))
                      return true;
              }
              //gives the first element by default
              iterator=fileList.listIterator();
              return false;
          }
  
      }
  </code></pre>