code: public static <T> Iterator<T> takeWhile(Iterator<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
          return new TakeWhileIterator<T>(self, condition);
      }
docs: Returns the longest prefix of elements in this iterator where
  each element passed to the given condition closure evaluates to true.
  <p>
  <pre class="groovyTestCase">
  def a = 0
  def iter = [ hasNext:{ true }, next:{ a++ } ] as Iterator
  
  assert [].iterator().takeWhile{ it {@code <} 3 }.toList() == []
  assert [1, 2, 3, 4, 5].iterator().takeWhile{ it {@code <} 3 }.toList() == [ 1, 2 ]
  assert iter.takeWhile{ it {@code <} 5 }.toList() == [ 0, 1, 2, 3, 4 ]
  </pre>
  
  @param self      the Iterator
  @param condition the closure that must evaluate to true to
  continue taking elements
  @return a prefix of elements in the given iterator where each
  element passed to the given closure evaluates to true
  @since 1.8.7