code: public static <T> T[] takeWhile(T[] self, @ClosureParams(FirstParam.Component.class) Closure condition) {
          int num = 0;
          BooleanClosureWrapper bcw = new BooleanClosureWrapper(condition);
          while (num < self.length) {
              T value = self[num];
              if (bcw.call(value)) {
                  num += 1;
              } else {
                  break;
              }
          }
          return take(self, num);
      }
docs: Returns the longest prefix of this array where each element
  passed to the given closure evaluates to true.
  <pre class="groovyTestCase">
  def nums = [ 1, 3, 2 ] as Integer[]
  assert nums.takeWhile{ it {@code <} 1 } == [] as Integer[]
  assert nums.takeWhile{ it {@code <} 3 } == [ 1 ] as Integer[]
  assert nums.takeWhile{ it {@code <} 4 } == [ 1, 3, 2 ] as Integer[]
  </pre>
  
  @param self      the original array
  @param condition the closure that must evaluate to true to
  continue taking elements
  @return a prefix of the given array where each element passed to
  the given closure evaluates to true
  @since 1.8.7