public static <E> Iterator<E> takeWhile(Iterable<E> iterable, Predicate<E> predicate) {
        dbc.precondition(iterable != null, "cannot takeWhile from a null iterable");
        return new TakeWhileIterator<E>(iterable.iterator(), predicate);
    }
public static < E > Iterator < E > takeWhile ( Iterable < E > iterable , Predicate < E > predicate ) { dbc . precondition ( iterable != null , "cannot takeWhile from a null iterable" ) ; return new TakeWhileIterator < E > ( iterable . iterator ( ) , predicate ) ; }
Creates an iterator yielding values from the source iterable up until the
passed predicate matches. E.g:
<code>takeWhile([2, 4, 3, 6], isEven) -> [2, 4]</code>

@param <E> the iterable element type
@param iterable the source iterable
@param predicate the predicate to be evaluated
@return the resulting iterator