Java9StreamUtil { static DoubleStream filter(DoubleStream stream, DoublePredicate predicate) { requireNonNull(stream); requireNonNull(predicate); try { return (DoubleStream) DOUBLE_FILTER_METHOD_HANDLE.invoke(stream, predicate); } catch (Throwable t) { throw new SpeedmentException(t); } } private  Java9StreamUtil(); @SuppressWarnings("unchecked") static DoubleStream takeWhile(DoubleStream stream, DoublePredicate predicate); @SuppressWarnings("unchecked") static DoubleStream dropWhile(DoubleStream stream, DoublePredicate predicate); @SuppressWarnings("unchecked") static IntStream takeWhile(IntStream stream, IntPredicate predicate); @SuppressWarnings("unchecked") static IntStream dropWhile(IntStream stream, IntPredicate predicate); @SuppressWarnings("unchecked") static LongStream takeWhile(LongStream stream, LongPredicate predicate); @SuppressWarnings("unchecked") static LongStream dropWhile(LongStream stream, LongPredicate predicate); @SuppressWarnings("unchecked") static Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate); @SuppressWarnings("unchecked") static Stream<T> dropWhile(Stream<T> stream, Predicate<? super T> predicate);  }
@Test void testPredicate() { assertDoesNotThrow(() -> STREAM_SUPPLIER.get().filter(LESS_THAN_C).forEach(System.out::println) ); }
@Test void testFilter() { final List<String> expected = STREAM_SUPPLIER.get() .filter(LESS_THAN_C) .collect(toList()); final List<String> actual = Java9StreamUtil.filter(STREAM_SUPPLIER.get(), LESS_THAN_C) .collect(toList()); assertEquals(expected, actual); }