code: public static <T> Iterator<T> take(Iterator<T> self, int num) {
          return new TakeIterator<T>(self, num);
      }
docs: Returns an iterator of up to the first <code>num</code> elements from this iterator.
  The original iterator is stepped along by <code>num</code> elements.
  <pre class="groovyTestCase">
  def a = 0
  def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
  def iteratorCompare( Iterator a, List b ) {
  a.collect { it } == b
  }
  assert iteratorCompare( iter.take( 0 ), [] )
  assert iteratorCompare( iter.take( 2 ), [ 0, 1 ] )
  assert iteratorCompare( iter.take( 5 ), [ 2, 3, 4, 5, 6 ] )
  </pre>
  
  @param self the Iterator
  @param num  the number of elements to take from this iterator
  @return an iterator consisting of up to the first <code>num</code> elements of this iterator.
  @since 1.8.1