code: public static <T> List<T> takeWhile(List<T> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure condition) {
          int num = 0;
          BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
          for (T value : self) {
              if (bcw.call(value)) {
                  num += 1;
              } else {
                  break;
              }
          }
          return take(self, num);
      }
docs: Returns the longest prefix of this list where each element
  passed to the given closure condition evaluates to true.
  Similar to {@link #takeWhile(Iterable, groovy.lang.Closure)}
  except that it attempts to preserve the type of the original list.
  <pre class="groovyTestCase">
  def nums = [ 1, 3, 2 ]
  assert nums.takeWhile{ it {@code <} 1 } == []
  assert nums.takeWhile{ it {@code <} 3 } == [ 1 ]
  assert nums.takeWhile{ it {@code <} 4 } == [ 1, 3, 2 ]
  </pre>
  
  @param self      the original list
  @param condition the closure that must evaluate to true to
  continue taking elements
  @return a prefix of the given list where each element passed to
  the given closure evaluates to true
  @since 1.8.7