@SuppressWarnings("unchecked")
    public static <T> Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate) {
        requireNonNull(stream);
        requireNonNull(predicate);
        if (TAKE_WHILE_METHOD_HANDLE == null) {
            throw newUnsupportedOperationException(TAKE_WHILE);
        }
        try {
            final Object obj = TAKE_WHILE_METHOD_HANDLE.invoke(stream, predicate);
            return (Stream<T>) obj;
        } catch (Throwable t) {
            throw new SpeedmentException(t);
        }
    }
Delegates a Stream::takeWhile operation to the Java platforms underlying
default Stream implementation. If run under Java 8, this method will
throw an UnsupportedOperationException.

@param <T> Element type in the Stream
@param stream to apply the takeWhile operation to
@param predicate to use for takeWhile
@throws UnsupportedOperationException if run under Java 8
@return a Stream where the takeWhile(predicate) has been applied
runtime-parent/runtime-core/src/main/java/com/speedment/runtime/core/stream/java9/Java9StreamUtil.java