code:     public static <E> Closure<E> whileClosure(final Predicate<? super E> predicate,
                                                final Closure<? super E> closure, final boolean doLoop) {
          if (predicate == null) {
              throw new NullPointerException("Predicate must not be null");
          }
          if (closure == null) {
              throw new NullPointerException("Closure must not be null");
          }
          return new WhileClosure<E>(predicate, closure, doLoop);
      }
  
      /**
       * Constructor that performs no validation.
       * Use <code>whileClosure</code> if you want that.
       *
       * @param predicate  the predicate used to evaluate when the loop terminates, not null
       * @param closure  the closure the execute, not null
       * @param doLoop  true to act as a do-while loop, always executing the closure once
       */
  