title: How to implement a jump iterator
body: <p>Implement next() and hasNext() of a jump iterator, the constructor was passed with another iterator. The next() function will return iterator.next().next()</p>
  
  <p>I have implemented below code, it doesn't look elegant at all.
  And for list {1, 9, 8, 7, 8, 2, 5}, it will only output 9, 7, 2.
  Any clue to do it in a better way?</p>
  
  <p>Basically this jump iterator is trying to iterator each element with one distance, for example, for 1,2,3,4,5, it will return 1,3,5</p>
  
  <pre><code>public class JumpIterator implements Iterator&lt;Integer&gt; {
      private Iterator&lt;Integer&gt; it;
  
      public JumpIterator(List&lt;Integer&gt; list){
          it = list.iterator();
      }
  
      @Override
      public boolean hasNext() {
          if(!it.hasNext()){
              return false;
          }else{
              it.next();
              return it.hasNext();
          }
      }
  
      @Override
      public Integer next() {
          return it.next();
      }
  }
  </code></pre>